Source: http://www.cnblogs.com/xiaowu/archive/2011/09/07/2169283.html
Use jquery to return various types of data (String, set (list <>), Class)Why is result. D used for returning in JSON data format?
here we'll talk about JSON
JSON is simply a JavaScript Object or array.
JSON Form 1: JavaScript Object {" firstname ":" Brett "," lastname ":" McLaughlin "," email ": "aaaa"}
JSON Form 2: JavaScript Array [{" firstname ":" Brett "," lastname ":" McLaughlin "," email ": "aaaa" },
{"Firstname": "Jason", "lastname": "hunterwang", "email": "BBBB"}]
Of course, JavaScript arrays and objects can be nested. For example, in Form 1, "Brett" can be replaced with a JS array or JS object. Which form does Microsoft Ajax return? It is the first one.
By default, the Microsoft framework returns a {"D": "data returned in the background"} Here we use the test in the above example as follows:
If the string type is returned in the above example, Firefox debugging is as follows:
Firefox debugging is as follows:
The returned data is stored in the D attribute of the JS object. That's why we always use result. D to retrieve the data returned by the Microsoft framework.