A deep understanding of JSON

Source: Internet
Author: User

JSON knowledge

The object representation of the JSON (JavaScript object notataion) JavaScript, but has now evolved into a lightweight form of data interaction.

Features: completely independent of the language of the text format, cross-platform, structured, convenient for people and machines to parse.

Usage Scenarios

1. data transfer between different languages (json is string, but it is formatted),

Front desk Javascript background Java attention is not a language, the background after querying the database, to pass data to the foreground, the data will be converted to list, set, map to the front end. But JS does not recognize. So the data in the background is converted to JSON and the foreground can be parsed. Background list---->json then the front desk can parse.

2.SSH----->easyui| extjs| Ajax|

The difference between JSON and XML, properties:

1) Josn is lightweight, and XML is heavyweight (Web. xml), which is typically used for framework configuration.

2) JOSN is structured, but properties are just key value (JSON can be used to pass objects.)

3. Self-understanding

since all of the data is exchanged in JSON, why do you want to convert to the front end to the object, just to point the properties to use it?

Json does not convert to objects there is no way to get what you want, then a bunch.

Can you transfer objects directly?

If the transitive object needs to be serialized, the receiving object needs to be deserialized and more cumbersome.

Cross-platform understanding?

How Java objects give JS needs to be made into a format that everyone knows.

Java objects only Java knowledge, JS object only JS know, but JSON is

Both JAVA and JS recognize that only the two languages you know can interact with each other.

the 4.JSON has these forms:

Object (Object) is an unordered"'name/value'the"collection. An object to"{"(opening parenthesis),"}"(closing parenthesis) ends. Each"name"followed by a":"(colon);"'name/value'the"Used between","(comma) delimited.

Array ( Array ) is anordered collection of values (value). An array begins with "["(the left square bracket), and"]"(the right square bracket) ends. Use ","(comma) to separate values.

VALUES ( value ) can be a string enclosed in double quotation marks (string), a numeric value (number ), True,false, null, Object,or array. These structures can be nested.

A deep understanding of JSON

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.