PDA

View Full Version : Javascript trick to find out when a web page was last updated



Renmoo
04-09-2008, 12:24 AM
Dear all,
There is a trick where you can type into the location bar which yields the "last updated" date and time of a web page, but I can't seem to find it from Google. Any ideas?

Cheers :)

Erayd
04-09-2008, 01:20 AM
No ideas, but I can have a crack at writing you one - which browser are you using?

Erayd
04-09-2008, 01:48 AM
Here you go - my attempt at coding what I think you're after:
javascript:try{var a=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){var a=new XMLHttpRequest();}a.open('HEAD',location,false);a. send(null);var s=a.getResponseHeader('Last-Modified');if(s!=null)alert('Last Modified: '+s);else{var s=a.getResponseHeader('Date');if(s!=null)alert('Da te: '+s);else alert('Unknown Date')}

Is that what you were looking for?

Renmoo
04-09-2008, 06:14 AM
Seems like it. Thanks Erayd! :D

Safari
04-09-2008, 07:06 AM
What is easier than this.

In Firefox, right-click on a page and choose "View Page Info" - it will show update time where it says "Modified:".

In Internet Explorer, right-click on the page and choose "Properties"

Safari
04-09-2008, 07:35 AM
What is easier than this.

In Firefox, right-click on a page and choose "View Page Info" - it will show update time where it says "Modified:".

In Internet Explorer, right-click on the page and choose "Properties"

That does not seem to be much use on closer inspection.
The date seems to show when the site was loaded not when it was last modified.

Renmoo
04-09-2008, 12:25 PM
That does not seem to be much use on closer inspection.
The date seems to show when the site was loaded not when it was last modified.
:p