All three arguments (including progressCallbacks, as of jQuery 1.7) can be either a single function or an array of functions. The arguments can also be null if no callback of that type is desired. Alternatively, use .done(), .fail() or .progress() to set only one type of callback.
When the Deferred is resolved, the doneCallbacks are called. If the Deferred is instead rejected, the failCallbacks are called. As of jQuery 1.7, the deferred.notify() or deferred.notifyWith() methods can be called to invoke the progressCallbacks as many times as desired before the Deferred is resolved or rejected.
Callbacks are executed in the order they were added. Since
deferred.then returns a Promise, other methods of the
Promise object can be chained to this one, including additional
.then() methods.
jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method.