解析客户端IP

<html>
<head>
<title>新浪IP解析接口的使用</title>
<metahttp-equiv=Content-Typecontent=text/html;charset=utf-8>
<scriptsrc="jquery-1.6.3.js"type="text/javascript"charset="utf-8"></script>
<script>
$.getScript("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js",function(){
 country=remote_ip_info.country;           //获得国家信息
 province=remote_ip_info.province;         //获得省份信息
 city = remote_ip_info.city;               //获得城市信息
 ip = remote_ip_info.start;                //获得IP地址

//district=remote_ip_info.district; //获得区信息

//ISP=remote_ip_info.isp; //获得ISP信息

//type=remote_ip_info.type; //获得服务提供商类型

//other=remote_ip_info.desc; //获取其他信息
 
 alert(country);
 alert(province);
 alert(city);
 alert(ip);
});
</script>
</head>
<body>


</body>
</html>

原文地址:https://www.cnblogs.com/zengpeng/p/3139984.html