title: Load image if found, else load another image
body: <p>what I need to do is simple to say but (for me) hard to do:</p>
  
  <p>using <strong>javascript</strong>, given an image name, ie "image01.jpg", I need to check if this image exists in a certain folder or path (local or on the web). If the image does not exist under that folder, I need to check if the same image exists in another folder.</p>
  
  <p>for example, with pseudo code</p>
  
  <pre><code>imageToFind = 'image01.jpg'
  path1 = 'users/john/images'
  path2 = 'users/mike/img'
  
  if path1+'/'+imageToFind exists
      //do something
  else
      if path2+'/'+imageToFind exists
          //do something
      else
          print('NOT FOUND')
  </code></pre>
  
  <p>what kind of approach do you suggest? I tryed to achieve this using ajax first, and then using javascript's Image() , but I failed in both these cases.</p>
  
  <p>Thanks in advance for any help, best regards</p>