JSON and JSONP

Source: Internet
Author: User

JSON is a lightweight data interchange format compared to XML.

JSON format: Data in key-value pairs, data separated by commas, curly braces to save the object, square brackets to save the array;

Jsonp is a cross-domain approach to data access.

Rationale: After the client declares the callback callback function, the client requests data across the domain through the script tag to the server, then the service side returns the appropriate JSON data and executes the callback function dynamically.

Summary JSONP:

Two points to be noted:

1. Do not provide error handling mechanism, there is data return, no content is not displayed, get a 404 error

2. If you use a service that you do not trust, it can cause great security risks.

JSON and JSONP

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.