title: Best way to check if AJAX request was successful in jQuery
body: <p>I've been checking to make sure my AJAX requests are successful by doing something like this:</p>
  
  <pre><code>$.post("page.php", {data: stuff}, function(data, status) {
      if(status == "success") {
          //Code here
      }
      else {
          //Error handling stuff
      }
  });
  </code></pre>
  
  <p>Is checking the status variable the best way to go about doing this, or is there a better way to make sure the request actually went through? I'm considering a "successful" request to be a request that hits the page I'm posting to successfully without timing out (if the server was down and an AJAX request was made right before it went down as an example) or returning any kind of 404 or 500 error.</p>