Skip to content

Instantly share code, notes, and snippets.

@jokeyrhyme
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jokeyrhyme/9f93805fe86c9f37f7e3 to your computer and use it in GitHub Desktop.
Save jokeyrhyme/9f93805fe86c9f37f7e3 to your computer and use it in GitHub Desktop.
log all arguments passed to jQuery.ajax()
(function () {
'use strict';
var oldAjax = $.ajax;
$.ajax = function () {
if (window.console && console.log) {
console.log(arguments);
}
return oldAjax.apply($, arguments);
};
}());
(function () {
'use strict';
var oldAjax = $.ajax;
$.ajax = function () {
var options = arguments[0];
if (options && typeof options === 'object') {
options.timeout = 5 * 60 * 1000; // 5 minutes
}
if (window.console && console.log) {
console.log(arguments);
}
return oldAjax.apply($, arguments);
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment