How to Use josnp to receive josn data in ajax. ajaxjosnp receives josn

Source: Internet
Author: User

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.

Related Article

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.