I have a problem, when submitting a form all active ajax request fail, and that triggers error event.
How to stop all active ajax requests in jQuery without trigerri
Here's what I'm currently using to accomplish that.
$.xhrPool = [];
$.xhrPool.abortAll = function() {
_.each(this, function(jqXHR) {
jqXHR.abort();
});
};
$.ajaxSetup({
beforeSend: function(jqXHR) {
$.xhrPool.push(jqXHR);
}
});
Note: _.each of underscore.js is present, but obviously not necessary. I'm just lazy and I don't want to change it to $.each(). 8P