Reputation: 2551
I am submitting a form via an Ajax call to a 3rd party server. I have to include a return url as hidden data type in the form. Upon submit the 3rd party processes the data and redirects via a 302 response to the url which I specify.
Is there anyway for me to read the header location redirect url, I can see it in the header response in developer tools but can't read the data into a variable as follows:
$.ajax({
url:'https://3rdparty.com/somescript.php',
type:'POST',
data:myVar,
crossDomain: true,
success:function(reply){
alert(reply.getResponseHeader("Location"));
}
});
Thank you in advace.
Alan.
Upvotes: 0
Views: 2353