macross
12-01-2005, 06:23 PM
okay. I have been searching from forums to sites and I have yet found a script that allows image swapping by actual day. Here is what I want to do:
On page load to see the day (ie Wednesday, Friday, Saturday) then load that day's image.
here's what I came up with - my C is very rusty and I know it sorta goes like this:
<SCRIPT language="JavaScript">
var wednesdayImage = 'Wednesday.gif';
var fridayImage = 'friday.gif';
var saturdayImage = 'saturday.gif';
var now = new Date();
var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
if (tday >= Wednesday && tday <= Saturday)
document.write('<IMG SRC="' + wednesdayImage + '">');
else
document.write('<IMG SRC="' + fridayImage + '">');
else
document.write('<IMG SRC="' + saturdayImage + '">');
</SCRIPT>
Am I wrong? help please.
On page load to see the day (ie Wednesday, Friday, Saturday) then load that day's image.
here's what I came up with - my C is very rusty and I know it sorta goes like this:
<SCRIPT language="JavaScript">
var wednesdayImage = 'Wednesday.gif';
var fridayImage = 'friday.gif';
var saturdayImage = 'saturday.gif';
var now = new Date();
var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
if (tday >= Wednesday && tday <= Saturday)
document.write('<IMG SRC="' + wednesdayImage + '">');
else
document.write('<IMG SRC="' + fridayImage + '">');
else
document.write('<IMG SRC="' + saturdayImage + '">');
</SCRIPT>
Am I wrong? help please.