Created
October 2, 2013 14:15
-
-
Save maiis/6794452 to your computer and use it in GitHub Desktop.
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
// save old function | |
$.ajaxOld = $.ajax; | |
// replace ajax call with our own that adds the delay | |
$.ajax = function() { | |
// save state from the original function call for use later | |
var args = [].slice.call(arguments); | |
var self = this; | |
// call the original ajax function in 1.5 seconds | |
setTimeout(function() { | |
$.ajaxOld.apply(self, args); | |
}, 1500); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment