title: AJAX best practice in 2020 (success vs. done)
body: <p>I've been using jQuery (3.4.1) and code like the following:</p>
  
  <pre><code>$.ajax({
      url: 'processing.php',
      type: 'POST',
      data: {ID: ID},
      dataType: 'json',
      success: function (response) { checkIfError(response);
          // do on success
      }, 
    error: handleError
  });
  </code></pre>
  
  <p>And while it works fine, depending what you look at, it appears that this code is deprecated.</p>
  
  <p><strong>Should I be using something like the following instead?</strong></p>
  
  <pre><code>$.post('processing.php', {ID: ID}, function(response){checkIfError(response);}, 'json')
  .done(function (response) {
      // do on success
  }).fail(handleError);
  </code></pre>
  
  <p>(My <code>checkIfError()</code> function checks if response is valid, otherwise triggers an appropriate message)</p>
  
  <p>Or is there something better / preferred that I should be using now? (since many of the SO answers are quite dated, and something better might be available.) </p>
  
  <p><strong>EDIT:</strong>
  Looking at this (also dated), it appears the success is only deprecated when used as a callback? So my prior code isn't actually deprecated?)
  <a href="https://stackoverflow.com/questions/15821141/deprecation-of-success-parameter-in-jquery-ajax">Deprecation of success Parameter in jQuery.ajax?</a>
  (Still want to know best practice for 2020...)</p>