asp学习网: 首页 >> xmlhttp对象 >> xmlhttp参考 >> xmlhttp:getallresponseheaders方法

xmlhttp:getallresponseheaders方法

getallresponseheaders

获取响应的所有http头
语法

strValue = oXMLHttpRequest.getAllResponseHeaders();

Example

var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
xmlhttp.open("GET", "http://localhost/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方法完成后才可调用该方法。 from:asp学习网/title:xmlhttp:getallresponseheaders方法/ time:2006-4-9 1:44:11

本文主题xmlhttp:getallresponseheaders方法

asp教程 ©2006-2007 aspxuexi.com | 关于站点 | 版权隐私 | 站内搜索
复制或者翻版 请于夜间进行