Created
March 2, 2010 16:11
-
-
Save ramhoj/319620 to your computer and use it in GitHub Desktop.
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
| $(document).ajaxComplete(function(event, request, options) { | |
| if (request.status == 401) { | |
| window.location = "/user_session/new"; | |
| } else if(/^text\/plain/.test(request.getResponseHeader('Content-type'))) { | |
| if(request.responseText == ' ') { | |
| $(document).trigger('close.facybox'); | |
| var removeVerify = window.location.href.match(/(^http.*)\?verify=1/); | |
| if (removeVerify) | |
| window.location = removeVerify[1]; | |
| else | |
| window.location = ''; | |
| } else { | |
| $.ajax($.extend(options, {'url': request.responseText, 'type': 'GET', 'data': null})); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment