title: Check if image exists on server using JavaScript?
body: <p>Using javascript is there a way to tell if a resource is available on the server? For instance I have images 1.jpg - 5.jpg loaded into the html page. I'd like to call a JavaScript function every minute or so that would roughly do the following scratch code...</p>
  
  <pre><code>if "../imgs/6.jpg" exists:
      var nImg = document.createElement("img6");
      nImg.src = "../imgs/6.jpg";
  </code></pre>
  
  <p>Thoughts? Thanks!</p>