您的位置:首页 > 其它

显示ip地理位置信息

2011-07-29 16:49 429 查看
<!DOCTYPE
html>
02
<
html
>
03
<
head
>
04
05
<
script
type
=
"text/javascript"
src
=
"http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"
>
06
</
script
>
07
<
meta
http-equiv
=
"content-type"
content
=
"text/html;
charset=gb2312"
>
08
</
head
>
09
<
body
>
10
<
center
style
=
"padding:400px
0"
>
11
ip:<
input
type
=
"text"
id
=
"ip"
/>
12
<
input
type
=
"button"
id
=
"idbutton"
value
=
"�ύ"
/>
13
</
center
>
14
</
body
>
15
<
script
type
=
"text/javascript"
>
16
$(document).ready(function(){
17
$("#idbutton").click(getAddress);
18
});
19
function
getAddress(obj) {
20
var
ip=$("#ip").val();
21
$.ajax(
22
{
23
url
: 'http://whois.pconline.com.cn/ipJson.jsp',
24
dataType
: "script",
25
data:{
26
callback:'alertaddress',
27
ip:ip
28
},
29
success
: function() {
30
}
31
});
32
}
33
function
alertaddress(json)
34
{
35
alert(json.addr);
36
}
37
</
script
>
38
</
html
>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: