title: Is it possible to check if a file returns a 404 error if it's on a different server with javascript or jQuery?
body: <p>Is it possible to check if a file returns a 404 error if it's on a different server using jQuery/javascript? </p>
  
  <p>I'm using the youtube api to get a HD screenshot for the video I'm embedding, but the JSON that it returns gives no indication of whether a HD screenshot for the video exists. </p>
  
  <p>the url for the screenshot is usually,
  <a href="http://img.youtube.com/vi/" rel="noreferrer">http://img.youtube.com/vi/</a> + video.ID + /maxresdefault.jpg</p>
  
  <p>but when it doesn't exist, i get this ugly low-res gray POS:
  <a href="http://img.youtube.com/vi/MAyTES9gDAU/maxresdefault.jpg" rel="noreferrer">http://img.youtube.com/vi/MAyTES9gDAU/maxresdefault.jpg</a></p>
  
  <p>So, basically, I want to check if the screenshot exists and if not, apply <code>display: none</code> to the div that holds it.</p>