Click to See Complete Forum and Search --> : Calendar


pigi
12-07-2003, 12:53 PM
I'm trying to create a digital calander. Now I have found some script put it's not quite qhat I'm looking for.

Can someone help me find the information I need to make this calender. I'm not really a webwizard put can often manage with a little copy pasting.

What am I looking for:

I want to make 12 html files. Every month one of these twelve files is loaded into the page.

For instance. I make a page that I name januari.htm. In januari the script shows this page to people who visit my site.

I don't think this is a really difficult script to write. But it is for someone with no experience.

Thanks for your help

jaegernaut
12-08-2003, 09:51 AM
I don't know if this is necessarily the best way to go about it, as I'm fairly new to Javascript as well, but this seems to work:

<script language="JavaScript">
var rightNow = new Date();
var calendar = new Array()
calendar[0] = "january.htm"
calendar[1] = "february.htm"
calendar[2] = "march.htm"
calendar[3] = "april.htm"
calendar[4] = "may.htm"
calendar[5] = "june.htm"
calendar[6] = "july.htm"
calendar[7] = "august.htm"
calendar[8] = "september.htm"
calendar[9] = "october.htm"
calendar[10] = "november.htm"
calendar[11] = "december.htm"

self.location.href = calendar[rightNow.getMonth()];

</script>