Skip to content

Instantly share code, notes, and snippets.

@kapkaev
Created April 12, 2012 17:41
Show Gist options
  • Save kapkaev/2369539 to your computer and use it in GitHub Desktop.
Save kapkaev/2369539 to your computer and use it in GitHub Desktop.
reset_ajax_resquests.js
$.xhrPool = [];
$.xhrPool.abortAll = function() {
_.each(this, function(jqXHR) {
jqXHR.abort();
});
};
$.ajaxSetup({
beforeSend: function(jqXHR) {
$.xhrPool.push(jqXHR);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment