Home > Web Front-end > JS Tutorial > Summary of methods to obtain IP address using js_javascript skills

Summary of methods to obtain IP address using js_javascript skills

WBOY
Release: 2016-05-16 16:42:38
Original
1983 people have browsed it

1. Method 1 of obtaining IP address using js

<script src="http://pv.sohu.com/cityjson&#63;ie=utf-8"></script> 
<script type="text/<A class=infotextkey href="http://www.jb51.net/" target=_blank>javascript</A>"> 
document.write(returnCitySN["cip"]+','+returnCitySN["cname"]) 
</script>
Copy after login

2, Method 2 of obtaining IP address using js

<script language="javascript" type="text/javascript" src="http://fw.qq.com/ipaddress"> 
</script>  
 <script>document.write("你的IP是:"+IPData[0]+",来自:"+IPData[2]); 
</script>
Copy after login

3. Method 3 of obtaining IP address with js, Tencent IP, convert to UTF-8:

<script type="text/javascript" src="http://fw.qq.com/ipaddress" charset="gb2312"></script>
$(document).ready(function() { 
  $("#ip").val(IPData[0]); 
  $("#add").val(IPData[2]); 
})
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template