extra: import at 3.0.1 beta 1
[mozilla-extra.git] / extensions / xmlextras / tests / syncget.html
blob289154ee158e765427d63230c2917b4928a6756e
1 <html>
2 <head><title>Synchronized GET test</title>
3 <style type="text/css">
4 .box {
5 display: block;
6 border: 1px solid black;
7 margin-bottom: 0.5em;
9 .boxheader {
10 font-weight: bold;
11 color: maroon;
13 pre {
14 margin-left: 2em;
16 </style>
17 <script type="text/javascript">
18 function execute()
20 var p = new XMLHttpRequest();
21 //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
22 p.open("GET", "data.xml",false);
23 p.send(null);
25 var str;
26 try {
27 var s = new XMLSerializer();
28 var d = p.responseXML;
29 str = s.serializeToString(d);
30 } catch (e) {
31 str = e;
33 document.getElementById("id1").firstChild.nodeValue = p.responseText;
34 document.getElementById("id2").firstChild.nodeValue = str;
35 document.getElementById("id3").firstChild.nodeValue = p.getAllResponseHeaders();
36 document.getElementById("id4").firstChild.nodeValue = p.status;
37 document.getElementById("id5").firstChild.nodeValue = p.statusText;
38 document.getElementById("id6").firstChild.nodeValue = p.readyState;
41 </script>
42 </head>
43 <body onload="execute();">
44 <h1>Synchronized GET test</h1>
46 <div class="box"><span class="boxheader">responseText</span>
47 <pre id="id1">@@No result@@</pre>
48 </div>
49 <div class="box"><span class="boxheader">responseXML serialized</span>
50 <pre id="id2">@@No result@@</pre>
51 </div>
52 <div class="box"><span class="boxheader">getAllResponseHeaders()</span>
53 <pre id="id3">@@No result@@</pre>
54 </div>
55 <div class="box"><span class="boxheader">status</span>
56 <pre id="id4">@@No result@@</pre>
57 </div>
58 <div class="box"><span class="boxheader">statusText</span>
59 <pre id="id5">@@No result@@</pre>
60 </div>
61 <div class="box"><span class="boxheader">readyState</span>
62 <pre id="id6">@@No result@@</pre>
63 </div>
65 </body>
66 </html>