Handling File Dates and Sizes


The document object also gives you access to web page dates and sizes in the Internet Explorer with the fileCreatedDate , fileModifiedDate , and fileSize properties. (Be warned , howevernot all servers fill in the information in these properties properly.) Here's an example that puts these properties to work, displaying the dates and size (in bytes) of a document:

(Listing 09-04.html on the web site)
 <HTML>      <HEAD>          <TITLE>Getting File Size and Date</TITLE>          <SCRIPT LANGUAGE="JavaScript">              <!--  function getSizesDates()   {   document.writeln("Document created: " + document.fileCreatedDate)   document.writeln("Last modified: " + document.fileModifiedDate)   document.writeln("File size: " + document.fileSize)   }  // -->          </SCRIPT>      </HEAD>      <BODY ONLOAD="getSizesDates()">          <H1>Getting File Size and Date</H1>      </BODY>  </HTML> 

When you open this document in a browser, it'll display when it was created, when last modified, and what its file size is in bytesif your server fills those properties in.



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net