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

来源:互联网 发布:sweet alert.js 编辑:程序博客网 时间:2024/05/16 14:35

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

原创粉丝点击