$. 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 serverCodePudding user response:
He returns the json type, then how can I getCodePudding user response: