title: When does an ajax request in jquery consider an http post request successful?
body: <p><strong>Here is an excerpt from <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" rel="nofollow">w3.org</a> on http responses:</strong></p>
  
  <p><strong>10.2 Successful 2xx</strong></p>
  
  <blockquote>
    <p>This class of status code indicates that the client's request was
    <em>successfully received, understood, and accepted.</em></p>
  </blockquote>
  
  <p><strong>10.2.1 200 OK</strong></p>
  
  <p>The request has succeeded. The information returned with the response is dependent on the method used in the request, for example:</p>
  
  <p>GET an entity corresponding to the requested resource is sent in the response;</p>
  
  <p>POST an entity describing or containing the result of the action;</p>
  
  <p>Is it considered "received, understood, and accepted" when the $_POST[] variables are stored in some other variable? </p>
  
  <p><strong>EDIT:</strong> here is the ajax call which calls an empty php file.</p>
  
  <pre><code>$.ajax({
      url: 'process.php',
      data: 'type=new&amp;title='+title+'&amp;startdate='+start+'&amp;zone='+zone,
      type: 'POST',
      dataType: 'json',
      success: function(response){
                   event.id = response.eventid;
                   $('#calendar').fullCalendar('updateEvent',event);
                  },
      error:  function(e){
                  alert('Error processing your request: '+e.responseText);
                  }
    });
  </code></pre>
  
  <p>and it calls the error part of the ajax call. But the console shows no errors.  <strong>Now why it chooses only error and not success ??</strong></p>