Web Hosting Talk







View Full Version : Cool JavaScript


FreewareTown.com
09-12-2005, 06:34 PM
here is some cool JavaScript that tell u when .htm pages was last updated on web sites

javascript:alert(document.lastModified)

it was some cool code i saw a TTS a while back or something

gilbert
09-13-2005, 08:04 PM
wow thats cool to see some simple javascript there man, and welcome to webhostingtalk please share more cause i havent had the patients to learn some really extensive languages

Dan L
09-13-2005, 09:16 PM
<p>
<script type="text/javascript">
document.write(document.lastModified);
</script>
</p> Should technically work, too, then, which would probably be more functional than an alert.

Nice tip :)

someotherguy
09-13-2005, 10:28 PM
Wow, thats neat. Does it only work on htm files?

Dan L
09-14-2005, 02:19 PM
someotherguy, that's more or less correct.

It has to be within an HTML page, though a page using PHP or Perl or some other language is fine.

The Prohacker
09-14-2005, 03:40 PM
Originally posted by DanX
someotherguy, that's more or less correct.

It has to be within an HTML page, though a page using PHP or Perl or some other language is fine.


With dynamic pages you would have to send a Last Modified header...

IE:
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');