Rumah  >  Artikel  >  hujung hadapan web  >  jquery实现通过ip获取地址

jquery实现通过ip获取地址

韦小宝
韦小宝asal
2017-11-18 11:09:332171semak imbas

一个用jquery实现的简单的通过用户ip获取地址的小应用,免费提供源码~~

1G]}Y~8L)PVL0~MF$~EN1(M.png

代码:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>PHP中文网</title>
	</head>
	<body>
		<p></p>
		<script src="http://www.jq22.com/jquery/jquery-2.1.1.js"></script>
			<script type="text/javascript">
        $.getScript(&#39;http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&#39;, function(_result) {
            if (remote_ip_info.ret == &#39;1&#39;) {
              $("p").text(&#39;国家:&#39; + remote_ip_info.country  +&#39;\n&#39;+&#39;省:&#39; + remote_ip_info.province +&#39;\n&#39;+&#39;市:&#39; + remote_ip_info.city +&#39;\n&#39;+&#39;区:&#39; + remote_ip_info.district + +&#39;\n&#39;+&#39;ISP:&#39; + remote_ip_info.isp +&#39;\n&#39;+&#39;类型:&#39; + remote_ip_info.type + +&#39;\n&#39;+&#39;其他:&#39; + remote_ip_info.desc);
            } else {
                alert(&#39;没有找到匹配的IP地址信息!&#39;)
            }
        });
</script>
</script>
	</body>
</html>

免费拿去研究吧!更多好的源码尽在PHP中文网,关注我们给你好看哦~

相关推荐:

css 、jquery实现3d立体旋转

jquery实现手势解锁源码

原生js实现可移动的提示div框源码

Atas ialah kandungan terperinci jquery实现通过ip获取地址. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel sebelumnya:css 、jquery实现3d立体旋转Artikel seterusnya:用css实现圆形进度条