A JSON object is a format that can be manipulated directly using jquery, and the object (class name) can be used to point out properties (methods), just as objects in JS do.
The JSON string is just a string, a whole, without intercepting the data stored in it, can not be used directly, unless you only want to alert () him;
JSON object:
var str2 = { "name": "haorooms", "sex": "man" };
JSON string:
var str1 = ‘{ "name": "haorooms", "sex": "man" }‘;
"JSON string" converted to "JSON object"
Please look at http://www.cnblogs.com/mawenqiangios/p/5186431.html.
Methods for reading JSON objects
var str2 = { "name": "haorooms", "sex": "man" };
You can read it like this:
alert(str2.name);//弹出” haorooms”。
The JSON we encounter is rarely so simple, such as a bit more complex JSON objects such as:
var str={"GetUserPostByIdResult":{"Age":"33","ID":"2server","Name":"haorooms"}};
Parsing by:
alert(str.GetUserPostByIdResult.Name); //弹出haorooms
This article is very simple, is a supplementary explanation of the previous articles! Only for Beginners!
The difference and conversion between JSON string and JSON object