{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
AJAX Source Viewer
View the source code of a Method from ASP.NET AJAX Library. Choose a method from the menu items above (Namespaces, Classes, or Methods).
Method 'deserialize(data, secure)'
Method: deserialize(data, secure)
Method Full Name:     Sys$Serialization$JavaScriptSerializer$deserialize(data, secure)
Class: JavaScriptSerializer
Namespace: Sys.Serialization
Source File: MicrosoftAjax.debug.js
1   Sys.Serialization.JavaScriptSerializer.deserialize = function Sys$Serialization$JavaScriptSerializer$deserialize(data, secure) {
2     /// <summary locid="M:J#Sys.Serialization.JavaScriptSerializer.deserialize" />
3     /// <param name="data" type="String"></param>
4     /// <param name="secure" type="Boolean" optional="true"></param>
5     /// <returns></returns>
6     var e = Function._validateParams(arguments, [
7     {name: "data", type: String},
8     {name: "secure", type: Boolean, optional: true}
9     ]);
10    if (e) throw e;
11    
12    if (data.length === 0) throw Error.argument('data', Sys.Res.cannotDeserializeEmptyString);
13    try {
14      var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)");
15      
16      if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(
17      exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, ''))) throw null;
18      return eval('(' + exp + ')');
19    }
20    catch (e) {
21      throw Error.argument('data', Sys.Res.cannotDeserializeInvalidJson);
22    }
23  }
This is the JavaScript source for method deserialize(data, secure) from ASP.NET AJAX Library. Full name for this method is Sys$Serialization$JavaScriptSerializer$deserialize(data, secure). It belongs to the class JavaScriptSerializer, which is in Sys.Serialization namespace. This source is in MicrosoftAjax.debug.js file.
Bookmark and Share This
About  Contact  Privacy Policy  Site Map