Forum Moderators: open
either way, i know that perl and php can do this as well as rexx... hopefully others will pipe in here with additional info and/or examples...
I actually wanted to stear clear of ASP because the server I'm using doesn't have it activiated. I know a great deal about ASP and could do it with that, but little about Javascript. I really wanted to be able to do it using Javascript. Does anyone know how?
Looks like I may be stuck gettig ASP installed!
You could have your main page running a script which runs through an array of the files whose last modified dates you want. That loop would
1. load the file in the iframe/popup/hidden frame
2. get the last modified date of the document in the iframe/popup/frame
3. repeat until the end of the array
hth,
g.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
<title>Last Modified</title>
<style type="text/css">
#lmh {
border: none;
padding: none;
margin: none;
}
#lmih {
float: right;
border: 1px dashed gray;
}
.mi {
border: 1px dashed gray;
margin: 2px;
padding: 2px;
}
</style>
<script type="text/javascript">
<!--
var mods = new Array(5);
mods[0] = "file1.htm";
mods[1] = "file2.htm";
mods[2] = "file3.htm";
mods[3] = "file4.htm";
mods[4] = "file5.htm";
function getMods() {
for (var i = 0; i < mods.length; ++i) {
makeFrame(mods[i], document.getElementById("lmh"), i);
}
var tmr = setTimeout('getMod()', 5000);
}
function getMod() {
for (var i = 0; i < mods.length; ++i) {
doGetMod(mods[i], document.getElementById("lmi"), i);
}
}
function makeFrame(file, divElm, count) {
var frm = document.createElement("iframe");
frm.src = file;
frm.setAttribute("id", ("ifrm" + count));
frm.setAttribute("width", "200px");
frm.setAttribute("height", "185px");
divElm.appendChild(frm);
}
function doGetMod(file, divElm, count) {
var p = document.createElement("p");
p.setAttribute("class", "mi");
p.innerHTML = file + ": Last Modified:<br />" +
window.frames[count].document.lastModified +
"<br /><br />";
divElm.appendChild(p);
document.getElementById("mb").setAttribute("onclick",
"window.location.reload();");
}
//-->
</script>
</head>
<body>
<div id="lmh">
</div>
<div id="lmih">
<div id="lmi"></div>
<div><input id="ms" type="button" value="Get Last Modified"
onclick="getMods();"/></div>
</div>
</body>
</html>
HTH
Jordan