1.
JSON:JavaScript Object notation(js objects notation)
To represent structured data as The standard format for JavaScript objects,
typically used to represent and transfer data on a Web site (some data is sent from the server to the client, so it can be displayed on a Web page )
Douglas Crockford ( proposed to promote the JSON)
Although it is based on JavaScript syntax, which can be used independently of JavaScript, many programming environments have the ability to read (parse) and generate json. (e.g. php)
A JSON object can be stored in its own file , which is simply a text file with the extension . JSON and MIME types It's Application/json.
2.json structure:
1. Object
A collection of name/value pairs:
name is of type string,
The value can be:string,number,object,array,trur,false,null
2. array of arrays
(ordered list of values)
3.
format / type of data in JSON
Note: You must use the "" double quotation mark, and the control word such as "\/BFNRT to be added \ escaped, you can use \u+ Four-bit hexadecimal number to denote Unicode character
Note: You cannot use octal, hex, can use scientific notation
Double-precision floating point
Non- NaN or Infinity
4. text <----> object Conversion
Sometimes you can set the XHR return response to JSON format, using:
Request.responsetype = ' json ';
But sometimes you need to convert the format
- Json.parse (): Accepts JSON objects in the form of text strings as arguments and returns corresponding objects.
- Json.stringify (): Accepts a JSON object as a parameter and returns the form of an equivalent text string.
mdn--javascript--Introduction--Chapter III Object--json--Knowledge Point Summary