Home>Article>Web Front-end> What is the principle of JSONP?

What is the principle of JSONP?

Guanhui
Guanhui Original
2020-06-24 16:40:55 2535browse

JSONP principle: first register a function on the client; then pass the name of the function to the server; then the server converts the JSON data into JSON data and passes the data into the function registered on the client using Javascript syntax; Finally, just receive JSON in the client registration function.

What is the principle of JSONP?

JSONP

JSONP (JSON with Padding) is a "usage mode" of JSON that can be used to solve Issues with cross-domain data access by mainstream browsers. Due to the same-origin policy, generally speaking, web pages located at server1.example.com cannot communicate with servers other than server1.example.com, with the exception of the HTML