Peter, on Wednesday, December 7, 2005 at 12:31 [email protected] wrote:
> Martin Heiden wrote: >> Do it on the serverside!!! > Maybe I'm a cycle head, but it seems silly to use computation cycles > (although very little) to compute a year that changes only once per > year. Use a server side include or hard code it in your footer template > and remember to change it in the new year. Guess this is my enterprise > application architecture brain talking here. You're right! I would do it with SSI or even more static (maybe by using a Dreamweaver library element). As others mentioned, the solution via JavaScript relies on a correct set clock at the client's side and you can't control that. So best practice is: don't trust in it! If one uses JavaScript, one should always ask, what happens if JavaScript is disabled? What happens if anything the script relies on, is different from the expectation? The site should be usable even if the scripts aren't executed. So if it is possible to do something at the serverside or even before the upload ;-). It should be done there! And if you have a wonderful behaviour which only works on the clientside, make the site work without it, or at least give the user a message that without JavaScript he'll miss something marvelous... An Example: On our site we've got an online-consultation tool which only works with JavaScript enabled. At the moment we are redoing the site and after the relaunch this tool will be started via click on an image button. On window.onload an unobstrusive JavaScript will exchange a button which links to a contact form, with the one to start the online-consultation tool. So a user without JavaScript can use the contact form and the one with JavaScript enabled has the chance to contact us by chat. ( Of course there is another link to the contact form ;-) ) And that's the magic: You're site looks well and is usable even without JavaScript, but the scripts are able to enhance the functionality and the usability of web pages without making them unusable if the scripts aren't executed. regards Martin ****************************************************** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************
