<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
</script>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>
<body>
<center style="padding:400px 0">
ip:<input type="text" id="ip"/>
<input type="button" id="idbutton" value="�ύ"/>
</center>
</body>
<script type="text/javascript">
$(document).ready(function(){
$("#idbutton").click(getAddress);
});
function getAddress(obj) {
var ip=$("#ip").val();
$.ajax(
{
url : 'http://whois.pconline.com.cn/ipJson.jsp',
dataType : "script",
data:{
callback:'alertaddress',
ip:ip
},
success : function() {
}
});
}
function alertaddress(json)
{
alert(json.addr);
}
</script>
</html>
显示ip地理位置信息
最新推荐文章于 2024-06-21 13:54:59 发布