getallresponseheaders
获取响应的所有http头
语法
strValue = oXMLHttpRequest.getAllResponseHeaders();
Example
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
xmlhttp.open("GET", "http://www.ajaxstu.com/sample.xml", false);
xmlhttp.send();
alert(xmlhttp.getAllResponseHeaders());
输出由web服务器返回的http头信息,example:
Server:Microsoft-IIS/5.1
X-Powered-By:ASP.NET
Date:Sat, 07 Jun 2003 23:23:06 GMT
Content-Type:text/xml
Accept-Ranges:bytes
Last Modified:Sat, 06 Jun 2003 17:19:04 GMT
ETag:"a0e2eeba4f2cc31:97f"
Content-Length:9
备注
每个http头名称和值用冒号分割,并以\r\n结束。当send方法完成后才可调用该方法。
xmlhttp:getallresponseheaders方法
原创文章如转载,请注明:转载自悠悠博客 [ http://www.ajaxstu.com/ ]
相关文章:
- xmlhttprequest:responsexml成员(2007-9-18 3:29:26)
- xmlhttp:abort方法(2007-7-17 10:56:13)
- xmlhttp:responsetext属性(2007-4-8 5:40:28)
- xmlhttprequest对象:status成员(2007-1-14 2:31:28)
- xmlhttp:onreadystatechange属性(2006-9-16 8:13:39)
- xmlhttprequest:statusText成员(2006-8-21 9:59:15)
- xmlhttp:responsebody属性(2006-6-16 1:37:26)
- xmlhttp:responsestream属性(2006-3-1 9:39:43)
- XMLHttpRequest对象(2006-2-24 4:49:19)
- xmlhttp:readyState属性(2006-1-8 3:54:36)
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
