Getting last modified html file date

How can I determine the last modified date of import of the html file into my web application?

The html file is on a different server, and different users can do updates when I get the page that I want to see when it was updated, so I can mark the updated date on my home page. I

+5
source share
5 answers

Use the document.lastModifiedJavascript property .

quirksmode has a nice function for formatting dates: http://www.quirksmode.org/js/lastmod.html

+7
source

I assume that you are using HTTP to fetch the page.

HTTP HEAD . (. http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html, 9.4)

"Last-Modified" . (. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, 14.29)

(, ) "Cache-Control: must-revalidate". (. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, 14.9.4)

+8

Last-Modfied Header .

Last-Modified entity-header , , .

   Last-Modified  = "Last-Modified" ":" HTTP-date
+3
source
<script type="text/javascript">
<!--
document.write(document.lastModified);
// -->
</script>
+2
source

There are several meta tag keys proposed that represent Dublin Core values ​​that can be used. See: fooobar.com/questions/284146 / ...

+1
source

All Articles