title: Checking if a URL is broken in Javascript
body: <p>This question has been posted on Stack before, but none so specific as to what I'm trying to understand.</p>
  
  <p>The simplest way to check if a URL is corrrect to send a http Head request. But how do you use that to specify the URL ?</p>
  
  <p><strong>I found this in a previous post :</strong></p>
  
  <pre><code>function UrlExists(url) {
    var http = new XMLHttpRequest();
    http.open('HEAD', url, false);
    http.send();
    return http.status!=404;
  }
  </code></pre>
  
  <p>But it doesn't seem to run in firebug for a few reasons.</p>
  
  <p>My apologies ahead of time for being daft.</p>