OLD | NEW |
| (Empty) |
1 <script> | |
2 var xhr = new parent.XMLHttpRequest; | |
3 xhr.open("GET", "xmlhttprequest-constructor-in-detached-document-frame.html"
); | |
4 xhr.onreadystatechange = function(evt) { | |
5 if (evt.target.readyState == 4) { | |
6 parent.setTimeout("pass()", 0); | |
7 var xhrConstructor = XMLHttpRequest; // The constructor may not be r
eachable as window object property after detaching the frame. | |
8 parent.document.body.removeChild(parent.document.getElementsByTagNam
e("iframe")[0]); | |
9 try { | |
10 var req = new XMLHttpRequest; | |
11 } catch (ex) { | |
12 var req = new xhrConstructor; | |
13 } | |
14 req.open("GET", "xmlhttprequest-constructor-in-detached-document-fra
me.html", false); | |
15 req.send(null); | |
16 } | |
17 } | |
18 xhr.send(null); | |
19 xhr = null; | |
20 </script> | |
OLD | NEW |