Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Refering to properties of other files

Using JavaScript to create a dynamic "Welcome" page.



8:48 am on Aug 23, 2001 (gmt 0)

10+ Year Member

I'd like to implement an automated "since you last visited" updates page, which covers multiple pages. What I'd like to do is read the lastModified property from all the main section pages on my site, then display links to any that have changed in a simple table.

This link display won't be a problem, but I'm very keen to get the lastModified property from all main pages working, if possible. I'm sure it is, but can't get it to work at the moment. Does anyone know how?


8:54 am on Aug 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Doing it on the server, using ASP say, is pretty easy.

Create an instance of the FileSystemObject, point it at your files and use the DateLastModified property:

More details on using the FileSystemObject are onBrainJar [brainjar.com].

obviously you'll need to drop a cookie that tells the server when the user last visited.


12:18 pm on Aug 23, 2001 (gmt 0)

10+ Year Member

Thanks joshie76, but I've got to try and get it working in JavaScript if I can, unfortunately.
Any other ideas?


3:31 pm on Aug 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

You can indeed access the last modified date of a document in JS

var lmdate = new Date(document.lastModified)

However, you will only be able to do this, as far as I can see, when a document is on the client. Perhaps you could invent some script that will go off and call a load of files for download into a hidden frame or something but I don't think people would like you for it.

How often do you change your site, perhaps a manual system would be the easiest and best as you could tell users exactly WHAT has been added/updated?

Sorry I can't be of more help :( - perhaps somebody else has some good ideas?



11:21 am on Aug 24, 2001 (gmt 0)

10+ Year Member

Thanks again joshie76.

Updates are done twice weekly, and although I have a script in place that presents the visitor with an "Updates since you were last here" page, you have to edit the "last updated" date for each section manually. This is what I'm trying to avoid having to do every time I add a new piece of news or an article etc. Automation via JS would be the ideal solution, but I'm not having any success still when trying to reference to lastModified properties of other files.

The client-side processing is obvious too, now that I actually stop for a moment and think about it. :) Downloading all the pages at once, hidden or otherwise, wouldn't be great for visitor satisfaction, so I may have to either stick with the manual updates or bin the idea altogether.

I'm not great at ASP (yet ;)) but as I learn more I might migrate to another host which would support this functionality.

Back to the drawing board then, unless anyone else has any suggestions?


Featured Threads

Hot Threads This Week

Hot Threads This Month