简体   繁体   English

http://api.easyjquery.com/ips/没有设置值

[英]http://api.easyjquery.com/ips/ didn't retern value

HTML: HTML:

<div class=iplookup>23.25.49.250</div>;
<div class=iplookup>188.2.50.62</div>;

jQuery: jQuery的:

$("div").mouseup(function () {
    IP = $(this).text();
    $.getJSON("http://api.easyjquery.com/ips/", {
        IP: IP
    }, function (data) {
        alert("XXX");
        alert(data.continentName + "\n" + data.countryName + " " + data.cityName);
        $(this).append("=" + data.countryName + "," + data.cityName);

    });

});

What is wrong with this code? 此代码有什么问题? Why isn't the alert() shown? 为什么未显示alert()

The service is not returning JSONP, which you need for cross domain calls. 该服务未返回跨域调用所需的JSONP。 See here for similar issue. 有关类似问题,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM