¿Existe un análogo de Java 'finalmente' en las llamadas jQuery AJAX? Tengo este código aquí. En mi siempre arrojo una excepción, sin embargo SIEMPRE quiero que vaya al método then () .
call.xmlHttpReq = $.ajax({
url : url,
dataType : 'json',
type : 'GET'
}).always(function(processedDataOrXHRWrapper, textStatus, xhrWrapperOrErrorThrown) {
throw "something";
}).then(function() {
alert("i want to always run no matter what");
});
He intentado usar done () , complete () y el otro always () , pero nada parece funcionar.
Aquí está JSFiddle:
always...