Created
January 18, 2015 16:09
-
-
Save dennisdegryse/9db5b34acb7efc8c8a69 to your computer and use it in GitHub Desktop.
HTTP Response sink (using JQuery)
This file contains hidden or 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 ajax(url, settings) { | |
| var completeHandler = undefined; | |
| if (settings.complete) { | |
| completeHandler = settings.complete; | |
| } | |
| settings['complete'] = function(data, category) { | |
| ajaxResponseTrap(data, category); | |
| if (completeHandler) { | |
| completeHandler(data, category); | |
| } | |
| }; | |
| $.ajax(url, settings); | |
| } | |
| function ajaxResponseCompleteTrap(data, category) { | |
| // do something | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment