title: Unable to download image every 5 seconds
body: <p>I'm using the below script to check for internet connection by downloading the image test.png. The issue I'm having is that it will only download the image once. This means, if there was internet connection when the page was first loaded it will display "Online" - however, if I disconnect the network cable, it won't say "Offline", as it should.</p>
  
  <p>Basically, once downloaded, the <code>readyState</code> will always be '<code>complete</code>' - However, I would like to perform the test again and again.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  setInterval('checkimage()', 1000);
  
  function checkimage() {
      var imgTmp = new Image();
      imgTmp.src = 'test.png';
      if (imgTmp.readyState == 'complete') {
          document.getElementById('div1').innerHTML = "&lt;font size=15 face=ariel color=green&gt;Online&lt;/font&gt;";
      } else {
          document.getElementById('div1').innerHTML = "&lt;font size=15 face=ariel color=red&gt;Offline&lt;/font&gt;";
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>