View Full Version : Link changing script

Tom Hogan
01-06-2004, 06:59 PM
Is there a script that will change the link according to the day, as in oin Monday, the button would link to one page, on Tuesday, another, and so on throughout the week - if there is, any help would be very much appreciated!

01-06-2004, 07:45 PM
Something like this:


var links=["sunday.html", "monday.html", "tue.html", "wed.html", "thur.html", "fri.html", "sat.html"];
var now=new Date();
var link = '<a href="'+links[now.getDay()]+'">link</a>';


More about Date and getDay() method (http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/date.html#1193573)

Tom Hogan
01-06-2004, 10:43 PM
Thanks, works great.