js获取http请求响应头信息

var req = new XMLHttpRequest();
req.open('GET', document.location, false);
req.send(null);
var headers = req.getAllResponseHeaders().toLowerCase();
alert(headers);

 

posted @ 2019-03-29 11:11  ylnog  阅读(9725)  评论(0编辑  收藏  举报