当前位置:开发者网络 >> 网页特效 >> 日期时间 >> 内容
精彩推荐
分类最新特效
分类热点特效
  
根据星期的不同分别指向指定页面
日期:2004-05-24   人气:   【字体: 】【收藏此文


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 1 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<SCRIPT>

<!--



function initArray()

{

this.length = initArray.arguments.length;

for (var i = 0; i < this.length; i++)

this[i+1] = initArray.arguments[i];

}



var DOWArray = new

initArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");

var today = new Date();

var day = DOWArray[today.getDay()];

alert("Today is " + day + "! If the file " + day + ".html had existed, you would have been taken there.")

if (day == "Monday") window.location = "Monday.html"

if (day == "Tuesday") window.location = "Tuesday.html"

if (day == "Wednesday") window.location = "Wednesday.html"

if (day == "Thursday") window.location = "Thursday.html"

if (day == "Friday") window.location = "Friday.html"

if (day == "Saturday") window.location = "Saturday.html"

if (day == "Sunday") window.location = "Sunday.html"

//-->

</SCRIPT>