Home >Web Front-end >JS Tutorial >JS cannot use jquery to obtain the IP address across domains_javascript skills

JS cannot use jquery to obtain the IP address across domains_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:38:581742browse

Get the IP address. JS can also get the client IP address. Everyone knows that JS cannot cross domain, so with the help of jquery, you can really get the IP address. The code is as follows, and it has passed the test:

<script language="javascript" src="http://www.jb51.net/jslib/jquery/jquery.js"></script> 
<script language="javascript"> 
jQuery(function($){ 
var url = 'http://chaxun.1616.net/s.php&#63;type=ip&output=json&callback=&#63;&_='+Math.random(); 
$.getJSON(url, function(data){ 
alert(data.Ip); 
}); 
}); 
</script>
Statement:
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