Re: JavaScript error
by =?Windows-1252?Q?Josu=E9_Figueira_Machado?= <jmachado(at)mindspring.com>
|
Date: |
Fri, 23 Jun 2000 15:24:51 -0400 |
To: |
<webmaster(at)aurorawebdesign.com>, "HWG techniques" <hwg-techniques(at)hwg.org> |
References: |
aurorawebdesign |
|
todo: View
Thread,
Original
|
|
Ann,
Date.getFullYear() is JavaScript 1.2 so it's not supported in NN3 and below.
Here's a little work around using your code. You may want to check on
earlier versions of IE and other OS, too. HTH.
Josu�
<SCRIPT language=JavaScript>
<!--
var now = new Date();
var textout;
var month = now.getMonth();
var date = now.getDate();
function getFullYear(d) {
var y = d.getYear();
if (y < 1000) y += 1900;
return y;
}
var year = getFullYear(now);
if (month==0) textout="January";
if (month==1) textout="Febuary";
if (month==2) textout="March";
if (month==3) textout="April";
if (month==4) textout="May";
if (month==5) textout="June";
if (month==6) textout="July";
if (month==7) textout="August";
if (month==8) textout="September";
if (month==9) textout="October";
if (month==10) textout="November";
if (month==11) textout="December";
textout += " " + date + ", " + year;
document.write ("<font size=3><font color=teal><strong> Welcome, on " +
textout + ".</strong></font>");
// -->
</SCRIPT>
----- Original Message -----
From: "Webmaster, Aurora Web Design" <webmaster(at)aurorawebdesign.com>
To: "HWG techniques" <hwg-techniques(at)hwg.org>
Sent: Friday, June 23, 2000 1:29 PM
Subject: JavaScript error
> I have a date stamp on a site which shows up fine in NS4.7 and
> IE5, but I get this error message in earlier versions of NS. The
> error message says "Date getFullYear is not a function." Does
> anyone know a way to make this work in earlier versions or do they
> just not support it at all? Here is the code I am using.
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA