Import from 1.9a8 tarball
[mozilla-extra.git] / extensions / xmlextras / tests / gethtml.html
bloba100c55eeba01b1ff2a5d9a3c7be846294135883
1 <html>
2 <head>
3 <title>GET test</title>
4 <style type="text/css">
5 .box {
6 display: box;
7 border: 1px solid black;
8 margin-bottom: 0.5em;
10 .boxheader {
11 font-weight: bold;
12 color: maroon;
14 pre {
15 margin-left: 2em;
17 </style>
18 <script type="text/javascript">
19 var p = new XMLHttpRequest();
21 function myfunc(e)
23 document.getElementById("id1").firstChild.nodeValue = p.responseText;
24 if (p.responseXML) {
25 var s = new XMLSerializer();
26 var d = p.responseXML;
27 var str = s.serializeToString(d);
28 document.getElementById("id2").firstChild.nodeValue = str;
30 document.getElementById("id3").firstChild.nodeValue = p.getAllResponseHeaders();
31 document.getElementById("id4").firstChild.nodeValue = p.status;
32 document.getElementById("id5").firstChild.nodeValue = p.statusText;
33 document.getElementById("id6").firstChild.nodeValue = p.readyState;
34 var eventProperties = "";
35 for (prop in e) {
36 eventProperties += prop + " : '" + e[prop] + "'\n";
38 document.getElementById("id7").firstChild.nodeValue =
39 "Event object: " + e + "\n" +
40 "Event properties:\n" + eventProperties;
43 p.onload = myfunc;
44 //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
45 p.open("GET", "display.html");
46 p.send(null);
47 </script>
48 </head>
49 <body>
50 <h1>GET test</h1>
52 <div class="box"><span class="boxheader">responseText</span>
53 <pre id="id1">@@No result@@</pre>
54 </div>
55 <div class="box"><span class="boxheader">responseXML serialized</span>
56 <pre id="id2">@@No result@@</pre>
57 </div>
58 <div class="box"><span class="boxheader">getAllResponseHeaders()</span>
59 <pre id="id3">@@No result@@</pre>
60 </div>
61 <div class="box"><span class="boxheader">status</span>
62 <pre id="id4">@@No result@@</pre>
63 </div>
64 <div class="box"><span class="boxheader">statusText</span>
65 <pre id="id5">@@No result@@</pre>
66 </div>
67 <div class="box"><span class="boxheader">readyState</span>
68 <pre id="id6">@@No result@@</pre>
69 </div>
70 <div class="box"><span class="boxheader">Event information</span>
71 <pre id="id7">@@No result@@</pre>
72 </div>
74 </body>
75 </html>