3 - The contents of this file are subject to the Mozilla Public
4 - License Version 1.1 (the "License"); you may not use this file
5 - except in compliance with the License. You may obtain a copy of
6 - the License at http://www.mozilla.org/MPL/
8 - Software distributed under the License is distributed on an "AS
9 - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10 - implied. See the License for the specific language governing
11 - rights and limitations under the License.
13 - The Original Code is Mozilla Test Cases.
15 - The Initial Developer of the Original Code is Netscape Communications
16 - Corp. Portions created by Netscape Communications Corp. are
17 - Copyright (C) 2001 Netscape Communications Corp. All
22 <html xmlns="http://www.w3.org/1999/xhtml">
24 <title>GET test</title>
25 <style type="text/css">
28 border: 1px solid black;
39 <script type="text/javascript">
40 var p = new XMLHttpRequest();
42 if (window.layoutTestController) {
43 layoutTestController.dumpAsText();
44 layoutTestController.waitUntilDone();
49 document.getElementById("id1").firstChild.nodeValue = p.responseText;
51 var s = new XMLSerializer();
52 var d = p.responseXML;
53 var str = s.serializeToString(d);
54 document.getElementById("id2").firstChild.nodeValue = str;
56 document.getElementById("id3").firstChild.nodeValue = p.getAllResponseHeaders();
57 document.getElementById("id4").firstChild.nodeValue = p.status;
58 document.getElementById("id5").firstChild.nodeValue = p.statusText;
59 document.getElementById("id6").firstChild.nodeValue = p.readyState;
60 var propNames = new Array;
62 if (prop != "timeStamp") {
67 var eventProperties = "";
68 for (i in propNames) {
69 var prop = propNames[i];
70 eventProperties += prop + " : '" + e[prop] + "'\n";
73 document.getElementById("id7").firstChild.nodeValue =
74 "Event object: " + e + "\n" +
75 "Event properties:\n" + eventProperties;
77 if (window.layoutTestController)
78 layoutTestController.notifyDone();
82 p.open("GET", "resources/xmlhttprequest-get-data.xml");
90 <body onload="mysend();">
93 <div class="box"><span class="boxheader">responseText</span>
94 <pre id="id1">@@No result@@</pre>
96 <div class="box"><span class="boxheader">responseXML serialized</span>
97 <pre id="id2">@@No result@@</pre>
99 <div class="box"><span class="boxheader">getAllResponseHeaders()</span>
100 <pre id="id3">@@No result@@</pre>
102 <div class="box"><span class="boxheader">status</span>
103 <pre id="id4">@@No result@@</pre>
105 <div class="box"><span class="boxheader">statusText</span>
106 <pre id="id5">@@No result@@</pre>
108 <div class="box"><span class="boxheader">readyState</span>
109 <pre id="id6">@@No result@@</pre>
111 <div class="box"><span class="boxheader">Event information</span>
112 <pre id="id7">@@No result@@</pre>