新浪IP解析接口的使用

  1. <html>
  2. <head>
  3. <title>新浪IP解析接口的使用</title>
  4. <meta http-equiv=Content-Type content=text/html;charset=utf-8>
  5. <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script>
  6. <script>
  7. $.getScript("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js",function(){
  8. country=remote_ip_info.country; //获得国家信息
  9. province=remote_ip_info.province; //获得省份信息
  10. city = remote_ip_info.city; //获得城市信息
  11. ip = remote_ip_info.start; //获得IP地址

  12. district=remote_ip_info.district; //获得区信息
  13. ISP=remote_ip_info.isp; //获得ISP信息
  14. type=remote_ip_info.type; //获得服务提供商类型
  15. other=remote_ip_info.desc; //获取其他信息


  16. document.getElementByIdx_x('ddd').innerHTML+="国家:"+country+"
  17. ";
  18. document.getElementByIdx_x('ddd').innerHTML+="省份:"+province+"
  19. ";
  20. document.getElementByIdx_x('ddd').innerHTML+="城市:"+city+"
  21. ";
  22. document.getElementByIdx_x('ddd').innerHTML+="IP地址:"+ip+"
  23. ";
  24. document.getElementByIdx_x('ddd').innerHTML+="区信息:"+district+"
  25. ";
  26. document.getElementByIdx_x('ddd').innerHTML+="ISP信息:"+ISP+"
  27. ";
  28. document.getElementByIdx_x('ddd').innerHTML+="提供商类型:"+type+"
  29. ";
  30. document.getElementByIdx_x('ddd').innerHTML+="其他信息:"+other+"
  31. ";
  32. });
  33. </script>
  34. </head>
  35. <body>

  36. <div id="ddd"></div>
  37. </body>
  38. </html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值