- <html>
- <head>
- <title>新浪IP解析接口的使用</title>
- <meta http-equiv=Content-Type content=text/html;charset=utf-8>
- <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></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; //获取其他信息
- document.getElementByIdx_x('ddd').innerHTML+="国家:"+country+"
- ";
- document.getElementByIdx_x('ddd').innerHTML+="省份:"+province+"
- ";
- document.getElementByIdx_x('ddd').innerHTML+="城市:"+city+"
- ";
- document.getElementByIdx_x('ddd').innerHTML+="IP地址:"+ip+"
- ";
- document.getElementByIdx_x('ddd').innerHTML+="区信息:"+district+"
- ";
- document.getElementByIdx_x('ddd').innerHTML+="ISP信息:"+ISP+"
- ";
- document.getElementByIdx_x('ddd').innerHTML+="提供商类型:"+type+"
- ";
- document.getElementByIdx_x('ddd').innerHTML+="其他信息:"+other+"
- ";
- });
- </script>
- </head>
- <body>
- <div id="ddd"></div>
- </body>
- </html>
新浪IP解析接口的使用
最新推荐文章于 2022-02-07 09:37:09 发布