How to Use josnp to receive josn data in ajax. ajaxjosnp receives josn
Recently, I encountered a problem when I checked the express delivery webpage. I called the express delivery 100 api, but the express delivery api does not allow cross-origin requests, that is, requests sent using 127.0.0.1 will be intercepted directly.
It's just a simple web page. I Don't Want To Do server forwarding on my own. I finally found a jsonp proxy provided by yahoo:
Http://query.yahooapis.com/v1/public/yql
Varqueryurl = "\" http://www.kuaidi100.com/query? Type = "+ $ (" # type "). val () + "& postid =" + $ ("# postid "). val () + "\" "; $. ajax ({url: 'http: // query.yahooapis.com/v1/public/yql', // jsonp proxy api dataType: "jsonp", data: {q: "select * from json url =" + queryUrl, format: "json"}, success: function (result) {var res = result. query. results. json; console. log (res );}},})});
The implementation method for receiving josn data using josnp in the above ajax is all the content that I have shared with you. I hope you can give us a reference and support for our customer base.