源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2020-08-19 05:38 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要: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>
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持编程素材网!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部