Home > Web Front-end > JS Tutorial > body text

Solution to invalid label error when Jquery obtains Json across domains

高洛峰
Release: 2017-06-07 13:49:53
Original
1368 people have browsed it

Finally, calm down carefully and read the json official document carefully and find 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's cross-domain is realized through the external link

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!