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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…