|
I found a simple script that displays a different url each day of the week.
Monday=1.htm
Tuesday=2.htm
...
Sunday=7.htm
I need a similar script that will display a different url on each day of the year.
Day1=1.htm
Day2=2.htm
...
Day365=365.htm
Here`s the script:
<script language="JavaScript">
function GetTodaysURL()
{
var locationlist = new URLList
(
"1.html", // Monday
"2.html", // Tuesday
"3.html",
"4.html",
"5.html",
"6.html",
"7.html" // Sunday
);
now = new Date();
num = now.getDay();
if (num == 0) num = 7;
location.href = locationlist.list[num-1];
}
function URLList ()
{
var argv = URLList.arguments;
var argc = argv.length;
this.list = new Object();
for (var i = 0; i < argc; i++)
this.list = argv;
this.count = argc;
return this;
}
</script>
</head>
<body>
<a href="java script:GetTodaysURL()">java script:GetTodaysURL()</a>
</body>
</html>
|
|
|
|
|
|
|
|
|
|