« 解析cookie欺骗实现过程windows 2003的基本优化 »

xmlhttp:getallresponseheaders方法

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方法完成后才可调用该方法。
原创文章如转载,请注明:转载自悠悠博客 [ http://www.ajaxstu.com/ ]

相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。