1function makeRequest()
2{
3
4 var doc = new XMLHttpRequest();
5 msg.text = "";
6 doc.onreadystatechange = function() {
7 if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
8 showRequestInfo("Headers -->");
9 showRequestInfo(doc.getAllResponseHeaders ());
10 showRequestInfo("Last modified -->");
11 showRequestInfo(doc.getResponseHeader ("Last-Modified"));
12
13 } else if (doc.readyState == XMLHttpRequest.DONE) {
14 var a = doc.responseXML.documentElement;
15 for (var ii = 0; ii < a.childNodes.length; ++ii) {
16 showRequestInfo(a.childNodes[ii].nodeName);
17 }
18 showRequestInfo("Headers -->");
19 showRequestInfo(doc.getAllResponseHeaders ());
20 showRequestInfo("Last modified -->");
21 showRequestInfo(doc.getResponseHeader ("Last-Modified"));
22 }
23 }
24
25 doc.open("GET", "data.xml");
26 doc.send();
27}