如何使用Javascrip或Jquery获取客户端IP地址。 ? [英] How Do I Get Client Ip Address Using Javascrip Or Jquery. ?

查看:110
本文介绍了如何使用Javascrip或Jquery获取客户端IP地址。 ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何jquery插件都可用??

解决方案

见这里 [ ^ ],这是第一个在google上弹出的答案,如果你不想花时间去搜索


< blockquote>有一个绝对免费的API将返回json响应。



URL:http://jsonip.com

回复示例: {ip:00.00.00.00,about:/ about,Pro!:http://getjsonip.com}





示例代码:

 


.ajax({
type:< span class =code-string> GET
async: false
url: http://jsonip.com
成功:功能(数据){
alert( data.ip);
}
});







有关许可证信息,请点击此处:< a href =http://getjsonip.com/> getjsonip.com [ ^ ]



希望这有帮助!!


Any jquery plugins are available??

解决方案

See here[^], it's first answer that pops on google if you would be bothered to take time to search


There is an absolutely free API which will return json response.

URL: http://jsonip.com
Response sample: {"ip":"00.00.00.00","about":"/about","Pro!":"http://getjsonip.com"}


Sample Code:


.ajax({ type: "GET", async: false, url: "http://jsonip.com", success: function (data) { alert(data.ip); } });




For license information click here: getjsonip.com[^]

Hope this helps!!


这篇关于如何使用Javascrip或Jquery获取客户端IP地址。 ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆