networkerror.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4. Test for #8135
  5. Thanks John Firebaugh for this test page based on his gist
  6. https://gist.github.com/807090
  7. Access this page through a web server, then stop said server and click the button.
  8. -->
  9. <head>
  10. <title>
  11. jQuery Network Error Test for Firefox
  12. </title>
  13. <style>
  14. div { margin-top: 10px; }
  15. </style>
  16. <script src="jquery.js"></script>
  17. <script type="text/javascript">
  18. $('button').live('click', function () {
  19. $.ajax({
  20. url: '/',
  21. error: function() {
  22. console.log( "abort", arguments );
  23. }
  24. }).abort();
  25. $.ajax({
  26. url: '/',
  27. error: function() {
  28. console.log( "complete", arguments );
  29. }
  30. });
  31. return false;
  32. })
  33. </script>
  34. </head>
  35. <body>
  36. <h1>
  37. jQuery Network Error Test for Firefox
  38. </h1>
  39. <div>
  40. This is a test page for
  41. <a href="http://bugs.jquery.com/ticket/8135">
  42. #8135
  43. </a>
  44. which was reported in Firefox when accessing properties
  45. of an XMLHttpRequest object after a network error occurred.
  46. </div>
  47. <div>Take the following steps:</div>
  48. <ol>
  49. <li>
  50. make sure you accessed this page through a web server,
  51. </li>
  52. <li>
  53. stop the web server,
  54. </li>
  55. <li>
  56. open the console,
  57. </li>
  58. <li>
  59. click this
  60. <button>button</button>
  61. ,
  62. </li>
  63. <li>
  64. wait for both requests to fail.
  65. </li>
  66. </ol>
  67. <div>
  68. Test passes if you get two log lines:
  69. <ul>
  70. <li>
  71. the first starting with "abort",
  72. </li>
  73. <li>
  74. the second starting with "complete",
  75. </li>
  76. </ul>
  77. </div>
  78. <div>
  79. Test fails if the browser notifies an exception.
  80. </div>
  81. </body>
  82. </html>