{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 '_serializeStringWithBuilder(object, stringBuilder)'
Method: _serializeStringWithBuilder(object, stringBuilder)
Method Full Name:     Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(object, stringBuilder)
Class: JavaScriptSerializer
Namespace: Sys.Serialization
Source File: MicrosoftAjax.debug.js
1   Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(object, stringBuilder) {
2     stringBuilder.append('"');
3     if (Sys.Serialization.JavaScriptSerializer._stringRegEx.test(object)) {
4       var length = object.length;
5       for (i = 0; i < length; ++i) {
6         var curChar = object.charAt(i);
7         if (curChar >= ' ') {
8           if (curChar === '\\' || curChar === '"') {
9             stringBuilder.append('\\');
10          }
11          stringBuilder.append(curChar);
12        }
13        else {
14          switch (curChar) {
15            case '\b':
16              stringBuilder.append('\\b');
17              break;
18            case '\f':
19              stringBuilder.append('\\f');
20              break;
21            case '\n':
22              stringBuilder.append('\\n');
23              break;
24            case '\r':
25              stringBuilder.append('\\r');
26              break;
27            case '\t':
28              stringBuilder.append('\\t');
29              break;
30            default:
31              stringBuilder.append('\\u00');
32              if (curChar.charCodeAt() < 16) stringBuilder.append('0');
33              stringBuilder.append(curChar.charCodeAt().toString(16));
34            }
35          }
36        }
37        } else {
38        stringBuilder.append(object);
39      }
40      stringBuilder.append('"');
41    }
This is the JavaScript source for method _serializeStringWithBuilder(object, stringBuilder) from ASP.NET AJAX Library. Full name for this method is Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(object, stringBuilder). 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