JavaScript 直接執行指定網頁(轉址)+Net轉址應用範例
Java Script 直接執行指定網頁(轉址)+Net轉址應用範例
使用方法:
<script type="text/javascript">
if(top.usrID == null)
{
location = "home.html"
}
</script>
Net轉址應用範例:
<html>
<script type="text/javascript">
function convurl()
{
var urlmap = location.href;
urlmap = urlmap.replace("http://",""); // 清除 http://
urlmap = urlmap.replace("/",""); // 清除 /
// 網址轉換
switch(urlmap)
{
case "service.tongtai.com.tw":
location = "http://service.tongtai.com.tw/ttphpweb/e_service";
break;
case "bbs.tongtai.com.tw":
location = "http://bbs.tongtai.com.tw/tongtaihome";
break;
case "webcalendar.tongtai.com.tw":
location = "http://webcalendar.tongtai.com.tw/webcalendar";
break;
}
}
</script>
<title>轉址服務</title>
</head>
<body onLoad="convurl();"></body>
</html>
使用方法:
<script type="text/javascript">
if(top.usrID == null)
{
location = "home.html"
}
</script>
Net轉址應用範例:
<html>
<script type="text/javascript">
function convurl()
{
var urlmap = location.href;
urlmap = urlmap.replace("http://",""); // 清除 http://
urlmap = urlmap.replace("/",""); // 清除 /
// 網址轉換
switch(urlmap)
{
case "service.tongtai.com.tw":
location = "http://service.tongtai.com.tw/ttphpweb/e_service";
break;
case "bbs.tongtai.com.tw":
location = "http://bbs.tongtai.com.tw/tongtaihome";
break;
case "webcalendar.tongtai.com.tw":
location = "http://webcalendar.tongtai.com.tw/webcalendar";
break;
}
}
</script>
<title>轉址服務</title>
</head>
<body onLoad="convurl();"></body>
</html>
留言
張貼留言