Javascript-ajax cross-domain jsonp is it good to get a value but always execute the error and the value returned is a little strange

Source: Internet
Author: User

**

Is there a great God to answer for a few days?

**
Doing is a courier interface for Ajax
Ajax cross-Domain JSONP is it good to get the value but always execute the error and the value returned is a little strange

The resulting data should not be preceded by a bunch of jquery plus a bunch of callback functions why don't I have this?

Support error after console appears to be

Original interface

Is there any problem with his server side?

Reply content:

**

Is there a great God to answer for a few days?

**
Doing is a courier interface for Ajax
Ajax cross-Domain JSONP is it good to get the value but always execute the error and the value returned is a little strange

The resulting data should not be preceded by a bunch of jquery plus a bunch of callback functions why don't I have this?

Support error after console appears to be

Original interface

Is there any problem with his server side?

JSONP requires server-side support, and if the server side supports cross-domain direct JSON on the line. If you do not support cross-domain you want to be able to modify the server-side support JSONP, but you can modify the support Jsonp why not modify the direct support across domains. If you can't change it, there's no way.

Jsonp works like this: When you request it, it passes to the server a function name, which is the random string in your debug that says no called, and then the server returns the code that calls the function, returning the data as a parameter to the call.

And you look at the Debug window, the returned data is a pure JSON string, so it is not jsonp.

  • 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.