JSON, a JavaScript object tag, is a lightweight data interchange format that is ideal for server-to-javascript interaction. JSON is a data format that is based on plain text.
JSON is the native format of JavaScript, and you can use JSON to transfer a simple string, number, Boolean, array, complex object.
When JSON represents an array, use [] contains all elements, each element is separated by commas, and the object object uses {} In JSON to contain a series of unordered Key-value key-value pairs, and value can also represent an object or an array.
JavaScript can use "." Directly when accessing JSON data. operator to access the properties of the JSON data, or assign a value to the property directly using "=".
JSON Data Structure transformation
Json2.js is a JS source file for converting JSON data structures to and from strings
1. Use the Stringify () method to string the JSON object
2. Use the parse () method to convert a JSON-formatted string into a JSON data object
3. Use the eval () method to convert a normal string to a JSON data object. Converting a JSON object to a string can be used anywhere else after the converted text string
JavaScript handles JSON-formatted data