Click to See Complete Forum and Search --> : document.lastModified problem


TonesDJ
06-18-2003, 11:20 AM
I have an html file that uses an external js file.
In the external js file I put a line:
var jsdate = document.lastModified;

In the html file I have a line:
document.write("Latest picture added on " + jsdate);

The html file displays the modified date for the html page but I want it to display the date modified for the external js file.

The external js file gets appended by a perl script I wrote. (a person will upload a picture along with picture description, when picture was taken etc. Then a thumbnail is created and the js file is appended with the info; added to an array).

Could someone please tell me what I am doing wrong. I know how to program in other languages, but I'm not real familiar with javascript.

Jona
06-18-2003, 11:22 AM
You cannot do it because a .js file is not a document, and has no objects--its objects are that of the page it is called from. Since you know Perl, why not use that to get the last modified date of the .js file? Wouldn't that be easier, too?

Jona