What i'm trying to accomplish is this:
0. nondescript php code executed here...
1. wait (random 120-240 secs)
2. copy lastmodified_date to old_lastmodified_date.
3. check last modified date of projectvibe.net/pvsamsite/songChange.txt
4. if last_modified_date > old_lastmodified_date then refresh page, otherwise repeat step 1.
I got as far as capturing the last modified date of the external file but that's it. Can someone please help me? Thanks!
<html>
<head>
<title>Last Modified</title>
<script type="text/javascript">
function getLastMod(){
var doc;
var myFrm = document.getElementById('myIframe');
var doc;
if ((doc = myFrm.contentDocument)
|| (myFrm.contentWindow && (doc = myFrm.contentWindow.document))) {
/* ... */
}
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" onload="getLastMod()" src="projectvibe.net/pvsamsite/songChange.txt" style="display:none;">
</iframe>
<span id="LastModified"></span>
</body>
</html>


Sign In
Create Account

Back to top









