Home > front end >  Ajax cross-domain access API, parsererror, jQuery XXX was not called
Ajax cross-domain access API, parsererror, jQuery XXX was not called

Time:11-21

My code is like this:
$. Ajax ({
Url: "http://ip.taobao.com/service/getIpInfo.php",
Data: {IP: "58.23.36.245"},
Async: true,
Type: "get",
DataType: "json",
Jsoncallback jsonpCallback: ", "
Success: the function (data, strStatus) {

Alert (data);

},
Error: function (XMLHttpRequest, the strError, strObject) {
Alert (XMLHttpRequest); Alert (strError); Alert (strObject);
}

});
Inquiry is taobao to access IP belongs to API, run after the browser F12 has response content:

By accessing the generated request url: "http://ip.taobao.com/service/getIpInfo.php? The callback=jsoncallback& IP=58.23.36.245 & amp; _=1490147946818 "are results:

But is can't get on the web page, the runtime pop-up error message:

This is the API address: http://ip.taobao.com/instructions.php

Have got a week didn't understand, and to help, or call a similar return json data API example of hair, very grateful!

CodePudding user response:

Cross domain, the interface is not the json data, it's no use you specify the json, can not get a return value of cross-domain, error, oneself do proxy server

CodePudding user response:

He returns the json type, then how can I get

CodePudding user response:

refer to the second floor sinat_33587250 response:
he returns json type, then how can I get
does not mean that the agent page in your web site, or use yql into json, look at the

The json cross-domain access online proxy API

CodePudding user response:

To solve, I also met the same problem
  •  Tags:  
  • Ajax