根据星期的不同分别指向指定页面 - 中国WEB开发者网络 (http://www.webasp.net) -- 网页特效 (http://www.webasp.net/javascript/) --- 根据星期的不同分别指向指定页面 (http://www.webasp.net/javascript/1/34.htm) |
| -- 发布日期: 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> |
| webasp.net |