js获取IP地址
使用搜狐获取IP地址:
var returnCitySN = {"cip": "58.16.0.0", "cid": "500000", "cname": "贵州省"};
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Document</title> <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script> <script type="text/javascript"> document.write('IP地址:' + returnCitySN["cip"] + ', CID:' + returnCitySN["cid"] + ', 地区:' + returnCitySN["cname"]); </script> </head> <body> </body> </html>