Last active
August 29, 2015 14:14
-
-
Save jokeyrhyme/9f93805fe86c9f37f7e3 to your computer and use it in GitHub Desktop.
log all arguments passed to jQuery.ajax()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
var oldAjax = $.ajax; | |
$.ajax = function () { | |
if (window.console && console.log) { | |
console.log(arguments); | |
} | |
return oldAjax.apply($, arguments); | |
}; | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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