URL redirect based on day (JS in HTML)

Hello, I’m trying to get instant redirect to different sites based on the day of the week. I have this over on my website which run on WordPress. Even though this seems like trivial mater so far I’m in no luck finding solution. I tried the same with sipnet in WPCode but the script just does not seem to take effect. Any help will be appropriated.

!DOCTYPE html>
<html>
<head>
<title>Crossroad</title>
<meta charset=”UTF-8″ />

<script>
var (today) = new Date().getDay;
switch (today) {
case 0: case 1: case 2: case 5: case 6:
window.location.replace = “https://www.youtube.com/”
break;

case 3: case 4:
window.location.replace = “https://www.google.com/”
break;
}
</script>
</head>
<body>
</body>
</html>

1 Comment

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer