title: How does successCallback really work?
body: <p>I am so baffled by callback, as in I don't understand it at all. The API I am using has an ajax function like so:</p>
  
  <pre><code>"ajax": function ( method, url, data, successCallback, errorCallback ) {
  $.ajax( {
          "type": method,
          "url":  url,
          "data": data,
          "dataType": "json",
          "success": function (json) {
              successCallback( json );
          },
          "error": function (xhr, error, thrown) {
              errorCallback( xhr, error, thrown );
          }
      } );
  </code></pre>
  
  <h2>From the API doc:</h2>
  
  <hr>
  
  <p>method  - string<br>
  The HTTP method to use for the AJAX request</p>
  
  <p>url - string<br>
  The URL to submit the data to</p>
  
  <p>data    - object<br>
  The data submitted to the server </p>
  
  <p>successCallback - function<br>
  Callback function on data retrieval success</p>
  
  <p>errorCallback   - function<br>
  Callback function on data retrieval error</p>
  
  <hr>
  
  <p>What I don't understand is when I remove successCallback, the event does not complete. Why is this so? I have hit the "success" parameter, as in I've succsesfully run the ajax request, so what does the callback here do? I would think that anything in "success" is basically saying, "do this stuff after the ajax request is complete".</p>
  
  <p>Thanks</p>