I use the code below from one Stackoverflow answer to abort AJAX call in JavaScript/jQuery.
$.xhrPool.abortAll = function () {
// alert('aborting.... outside');
$(this).each(function (idx, jqXHR) {
//jqXHR.abort();
if (jqXHR && jqXHR.readyState != 4) {
alert('aborting.... outside');
jqXHR.abort();
}
});
$.xhrPool.length = 0
clearTimeout(timeoutOfCall);
timeoutOfCall = null;
};
But, when I call this function like this :
$.xhrPool.abortAll();
it generate error in "unknown property" in IE 9 and also not working in Chrome. It is only working in FF.