网站中的客户端IP地址 [英] client ip address in website
本文介绍了网站中的客户端IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何发布一个html编码的网站,显示浏览用户的IP地址,如你正在从xxxx(客户端IP)浏览
解决方案
你可以,转发它通过服务器端使用JSONP
< script type = 应用/ JavaScript的跨度>>
function getip(json){
alert(json.ip); // 提醒IP地址
}
< / script>
< script type = application / javascript src = http://jsonip.appspot.com/?callback=getip>< / script>
或者您可以使用网站提供的在线服务,例如 link [ ^ ]
how i publish a html coded website which shows the browsing user ip address like "you are browsing from x.x.x.x (client ip)"
解决方案
You can, relaying it via server side with JSONP
<script type="application/javascript"> function getip(json){ alert(json.ip); // alerts the ip address } </script> <script type="application/javascript" src="http://jsonip.appspot.com/?callback=getip"></script>
Or you can use the online services provided by websites, such as link[^]
这篇关于网站中的客户端IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文