Click to See Complete Forum and Search --> : Schedule page display


sgron
12-04-2002, 09:08 AM
I need to be able to pre-schedule what day(s) specific pages are displayed or when specific links become live. I am using DreamweaverMX for site development. It has been suggested that adding java script to the Dreamweaver html code may automate the scheduling. I have done a little searching of some of the scripts available online, but haven't found anything that sounds right. Can anybody suggest such a script or something else I might check into?

Thanks.

AdamGundry
12-04-2002, 10:28 AM
The easiest way to do this is probably to generate the scheduled hyperlinks using JavaScript, something like the following:


var NowDate = new Date();
var ShowDate = new Date(2003,0,1);
if (NowDate.getTime > ShowDate.getTime){
document.write('<a href="time1.html">Can't see this until 1st January 2003</a>');
} else{
document.write('Page not yet available.');
}


Bear in mind that this will fail for any user without JavaScript support, and it is fairly easy to circumvent if a user wishes to look at a page ahead of schedule.

The date it becomes active is set in the ShowDate variable. You could also express this as Date("January 1, 2003");.

Hope this helps

Adam