JSON in JavaScript Asp.net, jsonasp.net
First official website http://www.json.org/js.html
Download json2.js to Github download https://github.com/douglascrockford/JSON-js
The background defines and generates json and returns to the foreground
Here we make a simple return in the background (in AbnormalCustomerList. ashx. cs)
String stbList = "{\" Rows \":[";
StbList = stbList + "{\" id \ ": 1, \" name \ ": \" Lin San \ ", \" sex \ ": \" male \", \ "birthday \": \ "1989/01/12 \"},";
StbList = stbList + "{\" id \ ": 2, \" name \ ": \" Zhang Wu \ ", \" sex \ ": \" male \", \ "birthday \": \ "1986/11/24 \"}";
StbList = stbList + "],";
StbList = stbList + "\" Count \ ": [{\" total \ ": 2}]"; // records a total of several data records returned
StbList = stbList + "}";
Context. Response. Write (stbList. ToString ());
Foreground reference
Var varReceiver = JSON. parse (e. result );
// Alert (varReceiver. Rows [0]. name)
For (var I = 0; I <varReceiver. Count [0]. total; I ++)
{
Alert (varReceiver. Rows [I]. name)
}
At alert, Popup will be followed to get Lin sanzhang Wu.
In addition: JSON. parse () and JSON. stringify () Usage
Http://blog.csdn.net/wangxiaohu__/article/details/7254598