RE: JavaScript error

by "Peter-Paul Koch" <gassinaumasis(at)hotmail.com>

 Date:  Mon, 26 Jun 2000 08:29:59 GMT
 To:  pbenoit(at)triton-network.com,
webmaster(at)aurorawebdesign.com,
hwg-techniques(at)hwg.org
  todo: View Thread, Original
>Just use some browser detection....

No, that's not necessary. Besides, you forget NN6 in the script below.

>now = new Date();
>ver = (document.layers || document.all) ? 1 : 0;
>ver ? year=now.getFullYear() : year=now.getYear();

It's even simpler:

var now = new Date();
if (now.getFullYear) Year = now.getFullYear();
else
{
   Year = now.getYear();
   if (Year < 2000) Year += 1900
}

See http://www.xs4all.nl/~ppk/js under Date and Time for a complete 
explanation of this millennium proof script.

ppk
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA