As far as I can tell from the documentation, there are two distinct ways of handling the response from a $.ajax()
call.
1) With functions passed into $.ajax()
's settings object:
$.ajax({
success: function(){ ... },
error: function(){ ... }
});
2) As chainable "callback hooks"
$.ajax({...})
.done(function(){ ... })
.fail(function(){ ... })
What are the important distinctions between these two approaches, and when should I choose one over the other?