Home > Web Front-end > JS Tutorial > body text

What are the json data formats?

醉折花枝作酒筹
Release: 2023-01-07 11:41:33
original
28475 people have browsed it

json has two data formats, namely: 1. Object format, "{"key1":obj,"key2":obj,"key3":obj...}"; 2. Array/ Collection format, "[obj,obj,obj...]".

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

json is a language-independent data exchange format. Using Json’s format and parsing can easily represent an object information. There are two formats of json:

①Object format: { "key1":obj,"key2":obj,"key3":obj...},

②Array/collection format: [obj,obj,obj...].

json is the abbreviation of JavaScript Object Notation. The word means JavaScript object notation. The json mentioned here refers to a data format similar to JavaScript objects. This data format is currently more popular. Gradually replacing the traditional xml data format.

Different from the json object, the attribute names and string values ​​in the json data format need to be enclosed in double quotes. Using single quotes or not using quotes will cause errors in reading data. Another data format of json is an array, which is the same as the array literal in javascript.

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of What are the json data formats?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!