1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN">
4 <title>XMLHttpRequest and responseXML -- script in the response
</title>
7 <p>The following line should say
"PASS" twice, and you should not
8 get any alerts or see the word
"FAIL" anywhere on the next line.
</p>
9 <p>FAIL: Script did not run.
</p>
10 <script type=
"text/javascript">
11 if (window
.testRunner
)
12 testRunner
.dumpAsText();
14 var p
= document
.getElementsByTagName('p')[1];
15 p
.firstChild
.data
= 'FAIL: Test script did not finish.';
16 window
.onerror = function (error
, file
, line
) { p
.firstChild
.data
+= ' (ERROR: ' + error
+ ' (line ' + line
+ '))'; }
17 if (!window
.XMLHttpRequest
)
18 window
.XMLHttpRequest = function () { return new ActiveXObject("Microsoft.XMLHTTP"); }
19 var r
= new XMLHttpRequest();
20 r
.open('GET', 'resources/018-test.xml', false);
22 var form
= r
.responseXML
.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'form')[0];
24 p
.firstChild
.data
= form
.firstChild
.data
+ " " + r
.responseXML
.title
;