Current location - Quotes Website - Signature design - The difference between JSON and JSONP, and how to use it.
The difference between JSON and JSONP, and how to use it.

1. Different references

1. JSON is a lightweight data exchange format.

2. JSONP is a "usage mode" of JSON, which can be used to solve the cross-domain data access problem of mainstream browsers.

second, the characteristics are different

1. JSON: based on? ECMAScript? A subset of js specification formulated by the European Computer Association, which uses a text format completely independent of the programming language to store and represent data.

2. JSONP: call the URL Service that provides JSONP support at the client to obtain data in JSONP format.

3. Different usage methods

1. JSON: Simple and clear hierarchy makes JSON an ideal data exchange language. Easy for people to read and write, but also easy for machine analysis and generation, and effectively improve the efficiency of network transmission.

2. JSONP:Callback is just a simple implementation of JSONP, which can realize more complex functions according to specific needs, such as dynamically integrating more variable data at the client to complete the paging function.

Baidu encyclopedia -jsonp

Baidu encyclopedia -JSON