I\'m using jQuery 1.6.2 to make a POST AJAX request to a page on the same domain. That page does a 302 redirect to another page.
Now, on my local machine this work f
function doAjaxCall() {
$.ajaxSetup({complete: onRequestCompleted});
$.get(yourUrl,yourData,yourCallback);
}
function onRequestCompleted(xhr,textStatus) {
if (xhr.status == 302) {
location.href = xhr.getResponseHeader("Location");
}
}
following questions related to your answer. you can find the answer from below links.
Catching 302 FOUND in JavaScript
How to manage a redirect request after a jQuery Ajax call