I use jQuery to make an AJAX POST request to my server, which can return HTTP response with status 302. Then JavaScript just sends GET request to this URL, while I\'d like t
function doAjaxCall() { $.ajaxSetup({complete: onRequestCompleted}); $.get(yourUrl,yourData,yourCallback); } function onRequestCompleted(xhr,textStatus) { if (xhr.status == 302) { location.href = xhr.getResponseHeader("Location"); } }