JSON is a kind of text-based data exchange method
The advantages of JSON:
1, based on plain text, cross-platform transmission is extremely simple;
2, JavaScript native support, background language almost all support;
3, lightweight data format, occupies very few characters, especially suitable for internet transmission;
4, readability is strong, although less than the XML so at a glance, but in a reasonable order after indentation is easy to identify;
5, easy to write and analysis, of course, if you want to know the data structure;
The format or rule of JSON:
JSON can describe a data structure in a very simple way, and XML can do it all, so it's completely pitches in cross-platform terms.
1. JSON has only two data type descriptors, curly braces {} and square brackets [], the remaining English colons: is the map, comma, is the delimiter, the English double quotation mark "" is the definition.
2, curly braces {} are used to describe a set of "different types of unordered key-value pairs" (each key-value pair can be interpreted as an attribute description of OOP), and square brackets [] are used to describe a set of "ordered sets of data of the same type" (which corresponds to an array of OOP).
3, if there are more than one of the two sets of children, it is separated by commas.
4. The key value pairs are separated by a colon: and the key name is suggested with the English double quotation mark "" to facilitate the parsing of different languages.
5, JSON internal common data types have string, number, Boolean, date, NULL, the string must be enclosed in double quotation marks, the rest are not used, the date type is more special.
What is JSON