Leiten Sie nach dem POST mithilfe des Location-Headers mit jQuery um
Ich möchte über das Symbol zum Ziel umleitenLocation
Header mit jQuery 1.7.
Mein Code sieht so aus
$('#creationLink').click(function(){
$.ajax({
type: 'POST',
url: '/',
success: function(data, textStatus, xhr) {
window.location = xhr.getResponseHeader("Location");
}
})
});
... aber es funktioniert nicht.xhr.getResponseHeader("Location")
ist Null.
HTTP-Header:
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
Wie kann ich mithilfe des Standortheaders umleiten?