Forum Home
Press F1
 
Thread ID: 93095 2008-09-03 12:24:00 Javascript trick to find out when a web page was last updated Renmoo (66) Press F1
Post ID Timestamp Content User
702290 2008-09-03 12:24:00 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 :)
Renmoo (66)
702291 2008-09-03 13:20:00 No ideas, but I can have a crack at writing you one - which browser are you using? Erayd (23)
702292 2008-09-03 13:48:00 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?
Erayd (23)
702293 2008-09-03 18:14:00 Seems like it. Thanks Erayd! :D Renmoo (66)
702294 2008-09-03 19:06:00 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 (3993)
702295 2008-09-03 19:35:00 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.
Safari (3993)
702296 2008-09-04 00:25:00 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
Renmoo (66)
1