A preliminary understanding of JSON

jacklove
Release: 2018-05-08 09:27:50
Original
1355 people have browsed it

JSON plays an important role in JavaScript, and this article will explain it in detail.

  

在 JavaScript 中创建 JSON 对象

Name:
Age:
Address:
Phone:

Copy after login

Like XML

JSON is plain text

JSON is "self-descriptive" (human readable)

JSON has a hierarchical structure (in values Value exists)

JSON can be parsed through JavaScript

JSON data can be transmitted using AJAX

Differences compared to XML

No end tag

Shorter

Read and write faster

Can use the built-in JavaScript eval() method for parsing

Use arrays

Not usedReserved words

Why use JSON?

JSON is faster and easier to use than XML for AJAX applications:

Using XML

Reading XML documents

Using XML DOM for looping Traverse the document

Read values and store in variables

Use JSON

Read JSONString

Use eval( ) Processing JSON string

This article provides a relevant explanation of json. For more learning materials, please pay attention to the php Chinese website.

Related recommendations:

Related knowledge about PHP filters

About the operation of PHP exception handling

About PHP file opening/reading/reading related knowledge

The above is the detailed content of A preliminary understanding of JSON. 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 admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!