日期:2014-05-16 浏览次数:20819 次
$.ajax({
url: "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=183.16.210.21",
//data: { format: "js", ip: "183.16.210.21" },
success: function (data) {
alert(data);
},
error: function (data) {
alert(data.responseText);
}
});
function loadScript(src,callBack){
var ie = /msie/i.test(navigator.userAgent);
var el=document.createElement('script');
el.src=url;
if(ie){
el.onreadystatechange=function(){
if(el.readyState=='loaded'
------解决方案--------------------
el.readyState=='complete') callBack&& callBack()
}
}else{
el.onload=callBack;
}
document.body.appendChild(el);
}
/////////////////////////////////////////////////
var url="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=183.16.210.21"
loadScript(url,function(){
alert(remote_ip_info.city );
});
$.getScript("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=183.16.210.21"
,function(){for(k in remote_ip_info)alert(k+'='+remote_ip_info[k])});