Skip to content

Instantly share code, notes, and snippets.

@dperrymorrow
Created May 16, 2014 17:02
Show Gist options
  • Save dperrymorrow/f05c0208d7c8aa022a74 to your computer and use it in GitHub Desktop.
Save dperrymorrow/f05c0208d7c8aa022a74 to your computer and use it in GitHub Desktop.
ajax filters
(function () {
"use strict";
window.utils = window.utils || {};
window.utils.ajaxFilters = {
initialize: function () {
$(document).ajaxError($.proxy(this, 'ajaxError'));
$(document).ajaxStart($.proxy(this, 'ajaxStart'));
$(document).ajaxComplete($.proxy(this, 'ajaxComplete'));
},
ajaxError: function (event, jqxhr, settings, exception) {
console.log('ajax error')
},
ajaxComplete: function () {
console.log('ajax complete')
},
ajaxStart: function () {
console.log('ajax start')
}
};
utils.ajaxFilters.initialize();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment