Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

weird behavior

Status
Not open for further replies.

Rydel

Programmer
Feb 5, 2001
376
CZ
Code:
<script>
document.write(&quot;This page was last updated on &quot;)
document.write(document.lastModified)
</script>

The above code is contained in footer.inc which gets included to every ASP page on the Web site via SSI (<!-- #include file=&quot;footer.inc&quot; -->). Instead of lastModified date it seems the above script always prints the time when the document got last loaded. Weird... Any help greatly appreciated. I think there was SSI command for that, which should work, but I don't remember the name of it.
---
---
 
Actually, I found the SSI command:

Code:
<!--#echo var=&quot;LAST_MODIFIED&quot;-->

But it doesn't display anything, even though #include works fine (I am running IIS). So is there a way to accomplish it through JavaScript?
---
---
 
I got the following from the Netscape Javascript reference.
========
The lastModified property is derived from the HTTP header data sent by the web server. Servers generally obtain this date by examining the file's modification date.

The last modified date is not a required portion of the header, and some servers do not supply it.
========

When I tested IIS by logging into my IIS server with telnet on port 80, I didn't get a Last-Modified header. IIS may have a setting that provides the information, but you'll want to check with the IIS documentation.
 
Obscurifer, thanks a lot! BTW, I am starting to wonder, could it be that whenever this ASP file is called and all of its parts are &quot;assembled&quot; together (through #includes)the server thinks that this file has just been modified???
---
---
 
That's an interesting thought. It wouldn't surprise me, but I couldn't say for sure. Please reply to this if you find out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top