1.在HTML页面里面引入<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
2.获取IP:returnCitySN["cip"]
例如在传参时候:"OperateIp": returnCitySN["cip"]
打印: document.write(‘IP地址:‘ + returnCitySN["cip"] + ‘, CID:‘ + returnCitySN["cid"] + ‘, 地区:‘ + returnCitySN["cname"]);
时间: 2024-11-08 10:57:19