1. What's the JSON?
JavaScript Object Notation (JavaScript objects Notation). JSON is a lightweight format for data interchange. For example, inside a JSON-formatted file, this can be:
{
"Name": "Zhangsan",
"Sex": "Male"
}
Looks much like Key-value's key-value pairs, very line JS object. But JSON is not satisfied, he has to have his own personality, so the key-value pair of keys must be in double quotation marks! At the same time, it is necessary to specify the value of the key-value correspondence:
The value of JSON allows you to:
1) Number (certificate or floating point)
2) string (in double quotes)
3) Logical value (TRUE or FALSE)
4) Array (in square brackets)
5) object (in curly braces)
6) NULL
Out of the above, no other, no like JS underfined, NAN, JSON refused to use.
2. If the properties of a JSON object are an array object, such as and get the properties of an array object?
Note: Never use the properties of an array object to get the properties of an array object, especially when there is only one object property in the array object, which is very confusing. If you have the properties of the array object property to get
The value of the array object, if there are multiple objects inside the array object, which of the properties of the array object do you actually get? or the design of the designer. So the proper way to get the property of the array formation is to iterate through the array and then traverse
Gets the value of the array object for each object's properties.
3. How to use JSON
JSON is generally based on the shape of the string in the process of data interaction, so for JS, how to convert the JSON string and JS object between each other is particularly important.
Json.parse (JSON string------------->>>>>>>>>>js object) Parse parse JSON parse is to convert the JSON string to J S object.
Json.stringify (JS object--------------->>>>>>>>>>json String)
4. It has always been thought that many of the interfaces that call others are failures, and the test of how successful the data is made. is to call the other person's interface or, return the parameters to overwrite the returned parameters.
Introduction to JSON and summary