If the XHR object no longer exists assume that the request was aborted.
authorJohn Resig <jeresig@gmail.com>
Wed, 26 Aug 2009 17:39:52 +0000 (17:39 +0000)
committerJohn Resig <jeresig@gmail.com>
Wed, 26 Aug 2009 17:39:52 +0000 (17:39 +0000)
src/ajax.js

index c6b8d0f..7760593 100644 (file)
@@ -370,7 +370,7 @@ jQuery.extend({
                // Wait for a response to come back
                var onreadystatechange = function(isTimeout){
                        // The request was aborted, clear the interval and decrement jQuery.active
-                       if ( xhr.readyState === 0 ) {
+                       if ( !xhr || xhr.readyState === 0 ) {
                                if ( ival ) {
                                        // clear poll interval
                                        clearInterval( ival );