<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="http://fw.qq.com/ipaddress"></script>
<script>
document.write(IPData[2]);
if(IPData[2]=='河北')
{
window.location='he.x.com';
}
if(IPData[2]=='河南')
{
window.location='HN.x.com';
}
if(IPData[2]=='黑龙江')
{
window.location='HLJ.x.com';
}
if(IPData[2]=='北京')
{
window.location='BJ.x.com';
}
</script></head><body>
</body>
</html>这腾讯的接口 失效了 想调用新浪 接口 http://pv.sohu.com/cityjson
http://int.dpool.sina.com.cn/iplookup/iplookup.php
代码该怎么样改?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="http://fw.qq.com/ipaddress"></script>
<script>
document.write(IPData[2]);
if(IPData[2]=='河北')
{
window.location='he.x.com';
}
if(IPData[2]=='河南')
{
window.location='HN.x.com';
}
if(IPData[2]=='黑龙江')
{
window.location='HLJ.x.com';
}
if(IPData[2]=='北京')
{
window.location='BJ.x.com';
}
</script></head><body>
</body>
</html>这腾讯的接口 失效了 想调用新浪 接口 http://pv.sohu.com/cityjson
http://int.dpool.sina.com.cn/iplookup/iplookup.php
代码该怎么样改?
<script type="text/javascript">
// 返回的是 json
alert( remote_ip_info.country )
alert( remote_ip_info.city )
</script>
逻辑判断 ,楼主 会改吧