Adds jQuery collection to objects that will be used as global events context if provi...
[jquery.git] / test / networkerror.html
1 <!DOCTYPE html>
2 <html>
3 <!--
4         Test for #8135
5
6         Thanks John Firebaugh for this test page based on his gist
7         https://gist.github.com/807090
8
9         Access this page through a web server, then stop said server and click the button.
10 -->
11 <head>
12         <title>
13                 jQuery Network Error Test for Firefox
14         </title>
15         <style>
16                 div { margin-top: 10px; }
17         </style>
18         <script src="../src/core.js"></script>
19         <script src="../src/support.js"></script>
20         <script src="../src/data.js"></script>
21         <script src="../src/queue.js"></script>
22         <script src="../src/attributes.js"></script>
23         <script src="../src/event.js"></script>
24         <script src="../src/sizzle/sizzle.js"></script>
25         <script src="../src/sizzle-jquery.js"></script>
26         <script src="../src/traversing.js"></script>
27         <script src="../src/manipulation.js"></script>
28         <script src="../src/css.js"></script>
29         <script src="../src/ajax.js"></script>
30         <script src="../src/ajax/jsonp.js"></script>
31         <script src="../src/ajax/script.js"></script>
32         <script src="../src/ajax/xhr.js"></script>
33         <script src="../src/effects.js"></script>
34         <script src="../src/offset.js"></script>
35         <script src="../src/dimensions.js"></script>
36         <script type="text/javascript">
37         $('button').live('click', function () {
38                 $.ajax({
39                         url: '/',
40                         error: function() {
41                                 console.log( "abort", arguments );
42                         }
43                 }).abort();
44                 $.ajax({
45                         url: '/',
46                         error: function() {
47                                 console.log( "complete", arguments );
48                         }
49                 });
50                 return false;
51         })
52         </script>
53 </head>
54 <body>
55         <h1>
56                 jQuery Network Error Test for Firefox
57         </h1>
58         <div>
59                 This is a test page for
60                 <a href="http://bugs.jquery.com/ticket/8135">
61                         #8135
62                 </a>
63                 which was reported in Firefox when accessing properties
64                 of an XMLHttpRequest object after a network error occured.
65         </div>
66         <div>Take the following steps:</div>
67         <ol>
68                 <li>
69                         make sure you accessed this page through a web server,
70                 </li>
71                 <li>
72                         stop the web server,
73                 </li>
74                 <li>
75                         open the console,
76                 </li>
77                 <li>
78                         click this
79                         <button>button</button>
80                         ,
81                 </li>
82                 <li>
83                         wait for both requests to fail.
84                 </li>
85         </ol>
86         <div>
87                 Test passes if you get two log lines:
88                 <ul>
89                         <li>
90                                 the first starting with "abort",
91                         </li>
92                         <li>
93                                 the second starting with "complete",
94                         </li>
95                 </ul>
96         </div>
97         <div>
98                 Test fails if the browser notifies an exception.
99         </div>
100 </body>
101 </html>