<html>
<head>
<script src="js/jquery-1.6.2.min.js"
type="text/javascript"></script>
<script
type="text/javascript">
var ipAddr="";
var city="";
var
province="";
var country="";
$.getScript('http://fw.qq.com/ipaddress',function(){
ipAddr=IPData[0];
})
$.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip='+ipAddr,function(){
city =remote_ip_info.city;
province = remote_ip_info.province;
country = remote_ip_info.country;
$('#txtIP').val(ipAddr);
$('#txtCountry').val(country);
$('#txtProvince').val(province);
$('#txtCity').val(city);
}
)
</script>
</head>
<body>
当 前 IP:<input
type="text" id="txtIP"/></br>
当前国家:<input type="text"
id="txtCountry"/></br>
当前省份:<input type="text"
id="txtProvince"/></br>
当前城市:<input type="text"
id="txtCity"/></br>
</body>
</html>
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)