【发布时间】:2012-11-30 17:27:54
【问题描述】:
我希望用户在每月的第一天被引导到 bar.html,在第二个月被引导到 gjb.html,在第三个月被引导到 guerr.html,在其他日期被引导到 error.html。
我做错了什么?无论用户计算机上的日期如何,以下仅加载 bar.html。
<html>
<script type="text/javascript">
currentTime = new Date();
if (currentTime.getDate() = 1)
window.location = "bar.html";
else if (currentTime.getDate() = 2))
window.location = "gjb.html";
else if (currentTime.getDate() = 3))
window.location = "guerr.html";
else window.location = "error.html";
</script>
</html>
我对这一切都是全新的,所以像你对一个白痴一样解释它。
【问题讨论】:
-
看看你的控制台,它应该会说类似 ReferenceError: Invalid left-hand side in assignment
标签: javascript date redirect