Redirigir después de POST usando el encabezado de ubicación con jQuery
Quiero redireccionar al objetivo usando elLocation
cabecera con jQuery 1.7.
Mi código se ve así
$('#creationLink').click(function(){
$.ajax({
type: 'POST',
url: '/',
success: function(data, textStatus, xhr) {
window.location = xhr.getResponseHeader("Location");
}
})
});
... Pero no funciona.xhr.getResponseHeader("Location")
es nulo.
Encabezados HTTP:
POST / HTTP/1.1
Host: localhost:9000
X-Requested-With: XMLHttpRequest
Content-Length: 0
HTTP/1.1 302 Found
Content-Type: text/plain; charset=utf-8
Location: http://localhost:9000/vIRdD0PdWp4/bearbeiten
Content-Length: 0
¿Cómo puedo redireccionar usando el encabezado de ubicación?