The code for handling Ajax timeouts was broken (the abort was being called too early...
authorJohn Resig <jeresig@gmail.com>
Tue, 18 Nov 2008 04:53:34 +0000 (04:53 +0000)
committerJohn Resig <jeresig@gmail.com>
Tue, 18 Nov 2008 04:53:34 +0000 (04:53 +0000)
src/ajax.js

index 55fc25d..d02d331 100644 (file)
@@ -393,11 +393,12 @@ jQuery.extend({
                                setTimeout(function(){
                                        // Check to see if the request is still happening
                                        if ( xhr ) {
-                                               // Cancel the request
-                                               xhr.abort();
-
                                                if( !requestDone )
                                                        onreadystatechange( "timeout" );
+
+                                               // Cancel the request
+                                               if ( xhr )
+                                                       xhr.abort();
                                        }
                                }, s.timeout);
                }