I have this jQuery ajax call:
$.ajax({
url : \'my_action\',
dataType: \'script\',
beforeSend : function(){
if(1 == 1) //just an example
Most of the jQuery Ajax methods return an XMLHttpRequest (or the equivalent) object, so you can just use abort().
var test = $.ajax({
url : 'my_action',
dataType: 'script',
beforeSend : function(){
if(1 == 1) //just an example
{
test.abort();
return false
}
},
complete: function(){
console.log('DONE');
}
});