Preserved Topic: "Last Visit" Problem |
|
---|---|
Author | Thread |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 05-30-2000 01:19
So, I'm trying to update my What's New page and I'd like to add a simple "You were last here on..." statement to give people a reference point for the list of updates. I found a script (below) that seems to do exactly what I want, except for one problem. In Netscape, it works fine. But, in IE4 the year comes out "3900." I finally broke down and got a book to start teaching myself Javascript, but I still don't know enough to figure out what the problem is here. Any help is much appreciated!<P><SCRIPT LANGUAGE="JavaScript"> |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 05-30-2000 03:15
The dateobj.getYear() function works differently on IE and NN, and it's a very buggy function. Instead, use the dateobj.getFullYear() function, which works correctly on both browsers. And you won't have to add 1900 to the result, either.<P> <IMG SRC="http://www.angelfire.com/ma2/slimesareneat2/images/slimesig.gif"> |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 05-30-2000 18:46 |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 06-09-2000 20:25
Wes - did the suggested fix work? If so, can you post the correct code? |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
posted 06-09-2000 20:34
Oh, yes it did. The corrected code is as follows: |