when below code executes it go to .ajaxComplete more than one time. Can i prevent this?
$('.log').ajaxComplete(function(e, xhr, settings) {
if (settings.url == 'ajax/test.html') {
alert('hi');
}
});
Only solution what I found is, make settings.url = ''
$('.log').ajaxComplete(function(e, xhr, settings) {
if (settings.url == 'ajax/test.html') {
settings.url = '';
alert('hi');
}
});
But I do not find it appropriate
This should not happen - check out this jsfiddle:
This may be happening if:
Otherwise, it should be called only once, as in the jsfiddle demo.