open-open-sync-send.htm (1103B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: open() - open() (sync) - send()</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[14]/ul/li[3] 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,4] 17 client.onreadystatechange = function() { 18 test.step(function() { 19 result.push(client.readyState) 20 }) 21 } 22 client.open("GET", "folder.txt") 23 client.open("GET", "folder.txt", false) 24 client.send(null) 25 assert_equals(client.responseText, 'top\n') 26 assert_array_equals(result, expected) 27 test.done() 28 }) 29 </script> 30 </body> 31 </html>