手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jQuery获取访问者IP地址的方法(基于新浪API与QQ查询接口)
jQuery获取访问者IP地址的方法(基于新浪API与QQ查询接口)
摘要:本文实例讲述了jQuery获取访问者IP地址的方法。分享给大家供大家参考,具体如下:$(document).ready(function()...

本文实例讲述了jQuery获取访问者IP地址的方法。分享给大家供大家参考,具体如下:

<script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ //通过调用新浪IP地址库接口查询用户当前所在国家、省份、城市、运营商信息 $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js',function(){ $(".country").html(remote_ip_info.country); $(".province").html(remote_ip_info.province); $(".city").html(remote_ip_info.city); $(".isp").html(remote_ip_info.isp); }); //通过调用QQIP地址库接口查询本机当前的IP地址 $.getScript('http://fw.qq.com/ipaddress',function(){ $(".ip").html(IPData[0]); }); }); </script> <div>国家:<span></span></div> <div>省份:<span></span></div> <div>城市:<span></span></div> <div>IP地址:<span></span></div> <div>运营商:<span></span></div>

希望本文所述对大家jQuery程序设计有所帮助。

【jQuery获取访问者IP地址的方法(基于新浪API与QQ查询接口)】相关文章:

jQuery实现dialog设置focus焦点的方法

js获取页面description的方法

jQuery判断指定id的对象是否存在的方法

js获取滚动距离的方法

jQuery获取页面元素绝对与相对位置的方法

jQuery实现不断闪烁文字的方法

jQuery实现html表格动态添加新行的方法

Jquery实现动态切换图片的方法

jQuery基于图层模仿五星星评价功能的方法

JQuery中层次选择器用法实例详解

精品推荐
分类导航