I have this jQuery ajax call:
$.ajax({
url : 'my_action',
dataType: 'script',
beforeSend : function(){
if(1 == 1) //just an example
{
return false
}
},
complete: function(){
console.log('DONE');
}
});
I want to stop the ajax call under the beforeSend
if the condition returns true
but return false does not stop the ajax call.
How can I stop
the ajax call on the beforeSend
?
======= UPDATE =========
return false
works as well.