可定义多种情况下跳转URL
可实现:指定地区跳转及指定地区屏蔽效果
如果IP判断接口失效可选其它可用接口即可。
<!DOCTYPEhtml>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>加载中...</title>
<meta name="keywords"content=""/>
<meta name="description"content=""/>
<script src="http://ip.ws.126.net/ipquery"></script>
<script type="text/javascript">
// <!-- 情况一限定地区跳转 -->
if(lc=="北京市" || lc=="上海市")
{document.location.href="http://so.com";}
// <!-- 情况二限定地区跳转 -->
else if(lc=="广州市" || lc=="梅州市")
{document.location.href="http://baidu.com";}
// <!-- 非上述地区 -->
else
{document.location.href="http://sohu.com";}
</script>
</body>
网友评论