判断其ip所属地区

新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js

新浪多地域测试方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=218.192.3.42

搜狐IP地址查询接口(默认GBK):http://pv.sohu.com/cityjson

搜狐IP地址查询接口(可设置编码):http://pv.sohu.com/cityjson?ie=utf-8

搜狐另外的IP地址查询接口:http://txt.go.sohu.com/ip/soip

腾讯的ip接口地址:http://fw.qq.com/ipaddress
显IP代码
全部调用

<script type=text/javascript src=http://fw.qq.com/ipaddress></script>
<script type=text/javascript>
document.write(IPData.join(‘ ‘));
</script>

效果:xxx.xxx.xxx.xxx 某某省 某某市
只调用地理位置
<script type=text/javascript src=http://fw.qq.com/ipaddress></script>
<script type=text/javascript>
document.write(IPData[2]);document.write(IPData[3]);
</script>
效果:某某省 某某市

原文地址:https://www.cnblogs.com/zhukezhuke/p/1947353.html