1/新浪定位javascript
<script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script>php
var city = remote_ip_info['city'];java
alert(city);api
2/百度ip定位app
var _script = document.createElement('script');
_script.type = "text/javascript";
_key = ""; //百度地圖能夠申請到
_script.src = "https://api.map.baidu.com/location/ip?ak=" + _key + "&coor=bd09ll&callback=citycallback"; //拼接URL
document.head.appendChild(_script);
function citycallback(data) {
console.log(data);orm
}ip