HTML:
<div class=iplookup>23.25.49.250</div>;
<div class=iplookup>188.2.50.62</div>;
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);
});
});
这段代码有什么问题?为什么没有alert()
显示?