posted 16 years ago
Hi, I have a question.
I want in one HTML page(first.html) to display some properties, for example date of last modification or file size of another file(second.html)
With document.lastModified and document.fileSize I can get properties of current-first.html file...but can I do that for second.html?
Maybe by giving path/filename of that second file...?
Lets say both files are in the same directory.
I have found some code that works for iframe, displaying properties of its content window. But I would like some general way of getting those other file properties, not just with iframes and their contents. Anyway, here's the mentioned code-original, i tried to change it to work my way, but getting null value when copying script to a <td> of a table:
<html>
<head>
<title>Last Modified</title>
<script type="text/javascript">
function getLastMod(){
var myFrm = document.getElementById('myIframe');
var lastModif = new Date(myFrm.contentWindow.document.lastModified);
document.getElementById('LastModified').innerHTML = "Prices correct as at: " +
lastModif.toLocaleString();
}
</script>
</head>
<body>
<span id="LastModified"></span>
<iframe id="myIframe" on_load=getLastMod() src="prices.html" style="display:none;">
</iframe>
</body>
</html>
Thanks in advance.
Marko