利用JS判断当前来路域名并自动跳转到指定页面
利用JS判断当前来路域名并自动跳转到指定页面
<!DOCTYPE html>
<html>
<head>
<title>玩命加载中……</title>
<!-- 判断访问的域名并自动跳转 -->
<script type="text/javascript">
if (window.location.href.indexOf("demo123.com") > -1) {
window.location.href='http://www.demo.com/123/';
} else if (window.location.href.indexOf("demo456.com") > -1) {
window.location.href='http://www.demo.com/456/';
} else if (window.location.href.indexOf("demo789.com") > -1) {
window.location.href='http://www.demo.com/789/';
}
</script>
</head>
<body>
</body>
</html>
|