Get jQuery post redirect response
Posted
by Wickethewok
on Stack Overflow
See other posts from Stack Overflow
or by Wickethewok
Published on 2010-03-19T21:22:11Z
Indexed on
2010/03/19
21:31 UTC
Read the original article
Hit count: 443
I've written some HTML/Javascript that sits on a third-party server for security reasons. This page performs a javascript post to another page on the same site. However, instead of responding with useful data, it instead wants to perform a redirect (if you would post via a normal HTML form to this page, it would redirect your browser). How can I process this process? I basically want to be able to extract the url's query parameters that it is trying to redirect with (and then put this link into a hidden form field).
Here is my basic ajax post...
$.ajax({
url: '/someurl/idontcontrol',
data: serialized_form_data,
async: false,
type: 'POST',
success: function(data, textStatus) {
$('#redirect_link').val(WHAT_DO_I_PUT_HERE);
}
});
Note that the URL I am posting to is not one that I control, so I have no power over what it returns.
Thanks!
© Stack Overflow or respective owner