Use of jsonp and jsonpcallback

1. jsonp, jsonpCallback Two parameters that can be customized when jsonp cross-domain

2. jsonp: The parameter name of the callback function name, the default callback, the server uses it to obtain the callback function name

3. jsonpCallback: Return the function name, automatically generated by jquery by default

4. When specifying jsonpCallback, you can write the callback function outside ajax to perform other operations. If not specified, you cannot do this and can only perform operations in success

Generally, the two methods used by jquery across domains are: $.ajax and $.getJSON

Finally, I calmed down carefully and read the json official document carefully and found this paragraph:

JSON data is a kind of structured data that can be easily parsed through JavaScript. If the obtained data file is stored on a remote server (with different domain names, that is, cross-domain data acquisition), you need to use the jsonp type. Using this type creates a query string parameter callback=? which is appended to the requested URL. The server should add the callback function name before the JSON data in order to complete a valid JSONP request. If you want to specify the parameter name of the callback function to replace the default callback, you can set the jsonp parameter of $.ajax().

In fact, the principle of jquery cross-domain is realized through external links