title: Jquery $.ajax returning undefined jqXHR in error handler
body: <p>I have the following Ajax call:</p>
  
  <pre><code>$.ajax({
          type: 'POST',
          contentType: 'application/json',
          url: reply_url,
          data: reply_data,            
          success: function(data, textStatus, xhr) {
            location.reload();
          },
          error: function(jqXHR, exception) {
            alert(jqXHR.status);
          }
        });
  </code></pre>
  
  <p>And I'm getting the following error when the server returns 500:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'status' of undefined 
  </code></pre>
  
  <p>What are the cases where jqXHR could be undefined?</p>
  
  <p>PS: I'm using Jquery v1.8.3</p>
  
  <p>EDIT:</p>
  
  <p>I noticed that this happens only in Ajax calls to my Ruby on Rails application. Ajax calls to another domains returns jqXHR as exptected.</p>