Created
October 16, 2017 15:57
-
-
Save ZackStone/75a9f99fccd896cf19c16c68c7b86c73 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).ajaxSuccess(function (event, jqXHR, ajaxSettings) { | |
function extrairUrlRedirecionamento(jqXHR) { | |
try { | |
var dados = $.parseJSON(jqXHR.responseText); | |
if (dados == null) { | |
return null; | |
} | |
if (dados.RedirecionarPara == null) { | |
return null; | |
} | |
return dados.RedirecionarPara; | |
} catch (exception) { | |
return null; | |
} | |
} | |
var urlRedirecionamento = extrairUrlRedirecionamento(jqXHR); | |
if (urlRedirecionamento != null) { | |
window.location = urlRedirecionamento; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment