标签:div display 搜狐 tar .net IV tle UI ack
直接输出访客ip及所在城市:
<script src="http://pv.sohu.com/cityjson?ie=utf-8" ></script> <script type="text/javascript"> document.write(‘IP:‘+returnCitySN.cip+‘<br>城市:‘+returnCitySN.cname); </script>
高德题图提供的可以获取到坐标
示例
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>IPTest</title> </head> <body> <span style="display:none;visibility:hidden" id="keleyivisitorip"></span> <script src="http://pv.sohu.com/cityjson?ie=utf-8" ></script> <script type="text/javascript"> document.write(‘IP:‘+returnCitySN.cip+‘<br>城市:‘+returnCitySN.cname); document.getElementById("keleyivisitorip").value = returnCitySN.cip; document.getElementById("keleyivisitorip").innerText = returnCitySN.cip; </script> <script type="text/javascript"> document.write(‘<br>keleyivisitorip innerText:‘+document.getElementById("keleyivisitorip").innerText); </script> </body> </html>
JAVA中经过nginx反向代理获取客户端ip并获取相关坐标等信息
标签:div display 搜狐 tar .net IV tle UI ack
原文地址:https://www.cnblogs.com/huanghongbo/p/9198628.html