title: Get remote url's last modified date with javascript
body: <p>I am trying to get the last date that a remote url was updated using javascript. I have currently come up with this:</p>
  
  <pre><code>function getlastmod(url)
  {
      var ifrm = document.createElement("IFRAME"); 
      ifrm.setAttribute("src", url);
      ifrm.setAttribute("id", "oIFRAME");
      ifrm.style.display = "none"; 
      var spanTag = document.createElement("span"); 
      spanTag.id = "oSpan"; 
      try 
      {
          var oIFrame = document.getElementById("oIFrame");
          var oSpan = document.getElementById("oSpan");
          oSpan.innerHTML = oIFrame.src + " last modified " +
          oIFrame.document.lastModified;
          outUpdate=oSpan;
      } 
      catch(E) {setTimeout("getlastmod();",50);}
  }
  </code></pre>
  
  <p>However, this code seems to always change 'outUpdate' to "undefined". The code is supposed to load the url contents into a frame and then use the document.lastModified function to get the last modified date.</p>
  
  <p>Any ideas on how to fix this?</p>
  
  <p>Thanks!
  Josh</p>