码迷,mamicode.com
首页 > Web开发 > 详细

通过js代码获取地址位置

时间:2016-05-11 12:47:00      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="js/jquery.js"></script>

<script type="text/javascript">
$.getScript(‘http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js‘, function(_result) {
if (remote_ip_info.ret == ‘1‘) {
alert(‘国家:‘ + remote_ip_info.country + ‘<BR>省:‘ + remote_ip_info.province + ‘<BR>市:‘ + remote_ip_info.city + ‘<BR>区:‘ + remote_ip_info.district + ‘<BR>ISP:‘ + remote_ip_info.isp + ‘<BR>类型:‘ + remote_ip_info.type + ‘<BR>其他:‘ + remote_ip_info.desc);
} else {
alert(‘没有找到匹配的IP地址信息!‘);
}
});
</script>
</head>
<body>

</body>

</html>

通过js代码获取地址位置

标签:

原文地址:http://www.cnblogs.com/zzh84615/p/5481077.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!