Hi everybody,
In my javascript application(using prototype), I need some info from a third party server an this server sometimes requires web interaction with the user, and for that reason it sends 302 http code with a new URL in the Location header. What I want is to capture this new URL to open it in a separate window, however the method getHeader('Location') is always returning null. Any Idea??? This is simplified version of my code:
UPDATE = function(){
new Ajax.Request(proxy_url,{
method: 'post',
parameters: "p1=1&p2=2",
on302: function(response){
OpenURLfromLocation(response);
},
onSuccess: function(transport){
alert("OK");
}
});}
OpenURLfromLocation = function(response){
alert(response.getHeader('Location'));
}
The ajax proxy is working properly and I can see on firebug that it behaves correctly until it tries to recover the location from the header.