您好,欢迎来到频厘教育网。
搜索
您的当前位置:首页js实现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.country +'\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>

Copyright © 2019- plrc.com.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务