获取地理位置

1、如果不需要精准的定位,还有一种通过IP地址获取当前城市的方法,采用新浪的api接口。

<script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script>
<script>
    var city = remote_ip_info['city'];
    console.log(remote_ip_info);
</script>

  

原文地址:https://www.cnblogs.com/theWayToAce/p/7063140.html