aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2008-11-18 04:53:34 +0000
committerJohn Resig <jeresig@gmail.com>2008-11-18 04:53:34 +0000
commitd81dfbcccf07aa63c6bf5beb10a2d37207d9e340 (patch)
tree46a3164adbdd7347cb2818b479dc3b2931d43fc1 /src/ajax.js
parentab551c2b14ac6b0511cf3da10ca224ce461a0f10 (diff)
downloadjquery-d81dfbcccf07aa63c6bf5beb10a2d37207d9e340.tar.gz
jquery-d81dfbcccf07aa63c6bf5beb10a2d37207d9e340.zip
The code for handling Ajax timeouts was broken (the abort was being called too early). Fixing this allows the test suite to work again.
Diffstat (limited to 'src/ajax.js')
-rw-r--r--src/ajax.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ajax.js b/src/ajax.js
index 55fc25d14..d02d33135 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -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);
}