Javascript 在xhr请求下http状态为301/302时读取位置标头

Javascript 在xhr请求下http状态为301/302时读取位置标头,javascript,jquery,ajax,xmlhttprequest,Javascript,Jquery,Ajax,Xmlhttprequest,嗨,我只是向一个页面发送了一个POST请求 var url4 = 'connect.php'; var params4 = 'app_id='+appid[i]; var token = Math['round'](new Date()['getTime']() / 1000); var http4 = new XMLHttpRequest(); http4['open']('POST', url4, true); http4['setRequestHeader']('Content-type'

嗨,我只是向一个页面发送了一个POST请求

var url4 = 'connect.php';
var params4 = 'app_id='+appid[i];
var token = Math['round'](new Date()['getTime']() / 1000);
var http4 = new XMLHttpRequest();
http4['open']('POST', url4, true);
http4['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
http4['setRequestHeader']('Content-length', params4['length']);
http4['setRequestHeader']('Connection', 'close');
http4['onreadystatechange'] = function () {
    if (http4['readyState'] == 4 && http4['status'] == 200) {
        http4['close'];
//alert(http4.responseText);
    };
};
http4['send'](params4);
}
我得到的回应如下:

答复:

HTTP/1.1 302 Found
Cache-Control: private, no-cache, no-store, must-revalidate
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Location: newpage?=3b26874b6ef331fa8a688b87e8414116
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Date: Sat, 05 Nov 2011 13:27:46 GMT
Content-Length: 0
我无法通过http4.getResponseHeader(“位置”)读取位置标头;
或者我不知道我去了哪里?是否仍然存在var http4=new XMLHttpRequest();