View Full Version : Display lastmodified of another page
sjhersha
12-13-2002, 08:50 PM
I'm looking for a clean example of how to write out / display the datetime of last time a page on another page was last updated.
Welcome to my new site(page):
This page last updated: 12/13/2002:12:00:00 UTC
My old site(page) was last updated: 11/03/2001:12:00:00 UTC
How can I get the date last modified of the old site's page and post on my current page without having to display the old site or reload the existing page, etc.?
chrismiceli
12-13-2002, 10:29 PM
you can't without having the other page opened somehow because the only way to use the last modified function is document.lastModified(), it has to be open so you could do like parent.windowname.document.lastModified().
i think.
moibloke
01-09-2003, 07:57 PM
I'm looking for something similar to what sjhersha wants except that I open the page in a diff frame to where I want the date displayed.
I have a list of page links in the left frame. Clicking on a link will open the associated page in the right frame.
I would like to display, in the left frame, the date the page in the right frame has been last modified.
ideally the date modified is displayed for each new file opened from the list.
I have this little script that will display the date in the actual file opened.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var m = "page last updated:" + document.lastModified;
var p = m.length-8;
document.writeln("<center>");
document.write(m.substring(p, 0));
document.writeln("</center>");
// End -->
</SCRIPT>
Anyone?
sjhersha
01-09-2003, 08:48 PM
What I have discovered so far on this is that really can't do much with client-side scripting of another page... but certainly is doable from server-side such as Active Server Pages. An example and sample code can be found at:
http://www.asp101.com/samples/modified.asp
Click on View ASP Source Code
Other related helpful links:
http://www.kamath.com/codelibrary/cl004_lastmod.asp
http://www.w3schools.com/asp/showasp.asp?filename=demo_datelastmodified
http://www.hotscripts.com/ASP/Scripts_and_Components/Date_and_Time/
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.