title: JQuery: AJAX error: get data sent to server
body: <p>This should be simple, but I can't find info anywhere on how to do it:</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: 'addToBasket.php',
      data: 'id='+id,
      // ....
      error: function(xhr, textStatus, error){
          // how to get the id sent to the server?
      },
      success: function(data, textStatus, xhr){}
  });
  </code></pre>
  
  <p>How can the error handling function access the data sent to the server in the request?</p>