|Refering to properties of other files|
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?
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.
Any other ideas?
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?
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?