打开页面自动检测星期并跳转到对应页面

2周前 (05-07 15:03)阅读14回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值4714
  • 级别管理员
  • 主题942
  • 回复2
楼主

打开页面后调用系统日期来自动检测星期几,然后通过判断后跳转到对应的网页,结合自己的需求来稍作修改即可。

<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
<SCRIPT>
<!--
function initArray() 
{//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++)
this[i+1] = initArray.arguments[i];
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
var DOWArray = new
initArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
var today = new Date();
var day = DOWArray[today.getDay()];
alert("今天是" + day + "! 如果" + day + ".html 这个文件存在的话,页面就会自动转到那个页面.")
if (day == "Monday") window.location = "https://www.wuming.ren/"
if (day == "Tuesday") window.location = "https://www.wuming.ren/c2.html"
if (day == "Wednesday") window.location = "https://www.wuming.ren/c3.html"
if (day == "Thursday") window.location = "https://www.wuming.ren/c4.html"
if (day == "Friday") window.location = "https://www.wuming.ren/c5.html"
if (day == "Saturday") window.location = "https://www.wuming.ren/6.html"
if (day == "Sunday") window.location = "https://www.wuming.ren/m/5/diary/"
//-->
</SCRIPT>


0
0
收藏0
回帖

打开页面自动检测星期并跳转到对应页面 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息