xhr-failure-behind-alert.html 322 B

12345678910
  1. Connecting to a server that doesn't respond.
  2. Run this from a local file to avoid cross-origin code path.
  3. <script>
  4. var req = new XMLHttpRequest;
  5. req.open("GET", "http://127.0.0.1:7", true);
  6. req.send();
  7. req.onerror = function() { document.write("onerror<br>"); }
  8. alert("PASSED if no crash or assertion failure");
  9. </script>