Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > JavaScript and CSS

JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-2008, 01:58 PM
erdubya erdubya is offline
Newbie
 
Join Date: Mar 2008
Posts: 1
Rep Power: 0
erdubya is on a distinguished road
Default Comparing lastmodified dates of external files...any ideas?

I'm having trouble figuring out how to compare last modified dates of an external file in javascript.

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!
Code:
<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>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Help Files xXHalfSliceXx Java Help 3 11-28-2006 11:30 PM


All times are GMT -5. The time now is 01:37 AM.

Contest Stats

Xav ........ 162.68
Sacback ........ 120.05
alearb8 ........ 120.05
tfusion ........ 120
amr2107 ........ 120
d3s!gn ........ 120
Qoolman21 ........ 120
Pillager ........ 108
donfrench ........ 100.05
mc2o0o ........ 100

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads