Click to See Complete Forum and Search --> : document.lastModified() returns current date


Nicodemas
02-19-2003, 01:28 AM
Web site in question: www.spangdahlem.af.mil

There's a javascript that I picked up from a freebie site that supposedly document.write()'s the date the document was last modified to the page. However, I'm not famililar with the document.lastModified function, and can only guess what it is doing. Anybody wanna take a look?

If it's something simple, heh.. chalk it up to 7 AM in the morning :) The blue nav bars at the top of the page are includes files, if that makes a difference (which I don't think it will.. but anyway..)

gil davis
02-19-2003, 05:57 AM
"document.lastModified" is not a function, it is a property obtained from the server. Some servers do not give you this information and instead return zero. Then some browsers (not NS 4) will see this and give you the current date instead.

Charles
02-19-2003, 06:11 AM
And if you browse on over to http://www.delorie.com/web/headers.cgi?url=http%3A%2F%2Fwww.spangdahlem.af.mil%2F you will note that your server is not sending the last modified date in the HTTP header. You will also note that your server is a Microsoft product and that's what you get when you use Microsoft. Try to find a server that's running Apache. It's free, open source and way much better.