3 <meta http-equiv=
"content-type" content=
"text/html;charset=utf-8">
5 <p>Test that XMLHttpRequest tolerates extra parameters to its methods.
</p>
9 testRunner
.dumpAsText();
11 var console_messages
= document
.createElement("ul");
12 document
.body
.appendChild(console_messages
);
16 var item
= document
.createElement("li");
17 item
.appendChild(document
.createTextNode(message
));
18 console_messages
.appendChild(item
);
21 function prettyPrintText(text
) {
24 return '"' + text
+ '"';
27 function dumpResponse() {
29 try { log (" Status: " + req
.status
); } catch (ex
) { log(" Exception getting status: " + ex
.message
); }
30 try { log (" StatusText: " + prettyPrintText(req
.statusText
)); } catch (ex
) { log(" Exception getting StatusText: " + ex
.message
); }
31 try { log (" ResponseText: " + prettyPrintText(req
.responseText
)); } catch (ex
) { log(" Exception getting ResponseText: " + ex
.message
); }
36 if (window
.XMLHttpRequest
) {
37 req
= new XMLHttpRequest();
40 req
= new ActiveXObject("Msxml2.XMLHTTP");
42 req
= new ActiveXObject("Microsoft.XMLHTTP");
46 req
.open('POST', 'resources/post-echo.cgi', false, null, null, null);
48 req
.setRequestHeader('foo', 'bar', null);
49 req
.overrideMimeType('text/xml', null);
51 req
.send('SUCCESS', null);
53 req
.getResponseHeader('Date', null);
54 req
.getAllResponseHeaders(null);
59 log("FAILURE: " + ex
);