Click to See Complete Forum and Search --> : Script For Image a Day


mbrovage
02-02-2003, 12:56 AM
This is a free script that I am trying to convert. The goal is to have a new pic everyday. The gif files are in the mentioned directory.

I think I am supposed to enter the directory + arday + .gif to get the img src for say, Sunday.

Can someone tell me what I am doing wrong? The script is not working.

Thanks.


<SCRIPT LANGUAGE="javascript">

<!-- Begin
today = new Date();
day = today.getDay();
arday = new Array("sunday.gif", "monday.gif", "tuesday.gif",
"wednesday.gif", "thursday.gif", "friday.gif", "saturday.gif");
document.write("<img src='"http://www.xxxxx.org/~xxxx/+ arday[day]+.gif"'>");
// End -->
</script>

kayzee
02-02-2003, 01:19 AM
try this

document.write("<img src='http://www.xxxxx.org/~xxxx/" + arday[day]+."gif'>");

Vamsee Krishna
02-02-2003, 09:28 AM
yeah, kayzee..that's right...have a look at your quotes...it should work once they r set right...