open-send-open.htm (1091B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: open() - send() - open()</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol/li[14]/ul/li[1] following::ol/li[14]/ul/li[2] following::ol/li[15]/ol/li[1] following::ol/li[15]/ol/li[2]" /> 8 </head> 9 <body> 10 <div id="log"></div> 11 <script> 12 var test = async_test() 13 test.step(function() { 14 var client = new XMLHttpRequest(), 15 result = [], 16 expected = [1, 'a', 'b', 'c'] 17 client.onreadystatechange = function() { 18 test.step(function() { 19 result.push(client.readyState) 20 }) 21 } 22 client.open("GET", "folder.txt") 23 result.push('a') 24 client.send() 25 result.push('b') 26 client.open("GET", "folder.txt") 27 result.push('c') 28 assert_array_equals(result, expected) 29 test.done() 30 }) 31 </script> 32 </body> 33 </html>