js实现PC端根据IP定位当前城市地理位置

PC端根据IP定位当前城市地理位置
js实现PC端根据IP定位当前城市地理位置。

<script type="text/javascript">
    $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js',function(_result){
        if(remote_ip_info.ret=='1'){
            alert('国家:'+remote_ip_info.county+'\n省:'+remote_ip_info.province+'\n市:'+remote_ip_info.city+'\n区:'+remote_ip_info.district+'\nISP:'+remote_ip_info.isp+'\n类型:'+remote_ip_info.type+'\n其他:'+remote_ip_info.desc);
        }else{
            alert('没有找到匹配的IP地址信息!');
        }
    });
</script>

转载自:http://www.qdfuns.com/notes/39005/3addca8c28e257c436fce8f906e6f0a7.html

猜你喜欢

转载自blog.csdn.net/cuilei210/article/details/78789880
今日推荐