HomeОбразованиеRelated VideosMore From: Dan Rothwell

Finding the last date a webpage was updated

43 ratings | 29027 views
Technique used to find the last date a web page was updated using java script. Paste the following into the URL bar and hit enter. javascript:alert(document.lastModified)
Html code for embedding videos on your blog
Text Comments (13)
Debra Mattes (8 months ago)
I can't seem to get the java script to work. can you contact me?
starpointstudios (3 months ago)
I have found that sometimes if it's 'pasted in' instead of 'typed in' it won't work. The browser will search for the command on google (or your default search engine) instead of running the javascript. If this is the case, simply just delete and retype the word 'javascript'. This happened to me today and that's how I got it to work.
GglSux (1 year ago)
This method often doesn't work anymore (and there are many possible reasons). One thing that can possibly make it work again is simply to "catch the return value" which will stop the "page-refresh". Simply put, use this code instead: javascript:var n=(window.alert(document.lastModified)); [As You can see all that has changed is that we declare a variable"n", that will catch the "default true" that otherwise would be returned by the invoking of the alert method, which would have caused the page-refresh] Best Regards
starpointstudios (3 months ago)
This method does still work. I just used it today to catch a website in a lie :)
Niyaz Meah (2 years ago)
thanks needed it for my homework
William Morris (1 year ago)
Niyaz Meah photo
Todde Q (1 year ago)
same lol
jose nunez (2 years ago)
Niyaz M
Kailas Nath (2 years ago)
Thanks a lot !!! Nice job . You saved me , Now my project bibliography look cool !!!
Auto Diamond (2 years ago)
hello, i try your way but it showing me my pc's last updated time every time. so now what ?
Jesús Edu S M (3 years ago)
thanks so much :D, I had a dude with javascript:
dejaillusion (5 years ago)
I read around with google and and all the results are saying is this javascript to use. I can say it's not working on the specific page i'm trying to find out the date it was modified.. all it is giving me is the NOW time :/. It's wierd because the page is not updating constantly at all. I've tried reading the element of the page and everything but to no success. What other codes can be used to find out the last modified date?
Bobert7765 (1 year ago)
I'm getting the exact same thing

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.