Click to See Complete Forum and Search --> : Script Needed: JS to display a different message for each day


cagliost
11-23-2003, 12:43 PM
Currently on my homepage I have to manually update the subtitle every day.

I need two similar Javascripts. This first must display a different piece of text for each day, so I can type in 100 different subtitles and then not have to update the subtitle for 100 days.

The second must display all previous subtitles up to the current date, for an archive page.

I can edit Javascript but not program from scratch, so any scripts would be helpful. Thanks. :)

Khalid Ali
11-23-2003, 01:42 PM
Here is how you can get this done..

1. create an array with all the subtitles.
2. then use the date object and hard code the starting date
3. then calculate the difference between today and the starting date,
4.finally get the validate that diference is not greater then hundred
andif not then show the appropriate array value using difference value

Now for the good solution for a situation like this ,You should use some server side language...