jQuery jqXHR – cancel chained calls, trigger error chain
(UPDATE: Please note that currently jQuery Promises are not compatible with the Promises/A+ specification – more info in this answer.) In your function where you create the AJAX request you can also create a deferred object and return a promise to the caller after binding its resolve and reject functions to the appropriate callbacks of … Read more