I have this jQuery ajax call:
$.ajax({
url : \'my_action\',
dataType: \'script\',
beforeSend : function(){
if(1 == 1) //just an example
xhr.done();
this works for me
$.ajax({
url : 'my_action',
dataType: 'script',
beforeSend : function(xhr){
if(1 == 1) //just an example
{
return false
};
xhr.done(); //this works for me
},
complete: function(){
console.log('DONE');
}
});
http://api.jquery.com/jquery.ajax/
jqXHR.done(function( data, textStatus, jqXHR ) {});
An alternative construct to the success callback option, refer to deferred.done() for implementation details.