I have a simple PHP page (for testing) that just calls , which is on the same server, in the same directory as another file with the following jQuery Javascript:header("Location: http://www.example.com");exit;
$(document).ready(function() {
jQuery.ajax({
type : 'GET',
url : 'bounce.php',
error : function(xhr, status, error) {
console.log("ERROR: ", xhr, xhr.status, xhr.getAllResponseHeaders());
},
complete : function(xhr, status) {
console.log("COMPLETE: ", xhr, xhr.status, xhr.getAllResponseHeaders());
}
});
});
I expected (from several other StackOverflow answers) for xhr.statusto return "302", but instead the AJAX call raises the error event (and then the "full" event) and xhr.statusreturns 0(zero) and .getAllResponseHeaders()returns null(as in the case of an error, so and in full functions).
Firebug "302 Moved Temporarily" . , , 302 ?. - , script script ? jQuery Javascript?