title: jQuery post fail callback does not display response for code 400
body: <p>I have a following jQuery post request:</p>
  
  <pre><code>$.post("ajax.php", data).done(
      function(response){
          // do something when response is ok
       }
     ).fail(
      function(response){
            $("#error").html(response);
       }
   );
  </code></pre>
  
  <p>In my <code>ajax.php</code> file when something goes wrong I return HTTP response code 400 with a message:</p>
  
  <pre><code>header("HTTP/1.0 400 Error");
  echo "Some error message";
  exit();
  </code></pre>
  
  <p>When I check the response for faulty call in my browser I can see the status code <code>Status Code:400 Bad Request</code> and a response text I passed in error message. But the jQuery's <code>.fail</code> callback is not displaying my <code>response</code>. </p>
  
  <p>How can I get the access to the fail/error response text? </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tested my code and the <code>.fail</code> callback is being triggered, I just cannot get the response message being displayed.</p>