aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-05-16 23:43:16 +0200
committerjaubourg <j@ubourg.net>2012-05-16 23:43:16 +0200
commitd55a764e6e3a5980fb9633df1303418bcb512327 (patch)
tree9823accea4c73e22143a33a7b2784c9a01f253a5 /src
parent9efe4d03df7ce417792152660a0bed36b261676e (diff)
downloadjquery-d55a764e6e3a5980fb9633df1303418bcb512327.tar.gz
jquery-d55a764e6e3a5980fb9633df1303418bcb512327.zip
When IE6 & IE7 serve from the cache in async mode, resolves the request asynchronously. Fixes #11778.
Diffstat (limited to 'src')
-rw-r--r--src/ajax/xhr.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js
index 013863d4e..186432f61 100644
--- a/src/ajax/xhr.js
+++ b/src/ajax/xhr.js
@@ -190,11 +190,13 @@ if ( jQuery.support.ajax ) {
}
};
- // if we're in sync mode or it's in cache
- // and has been retrieved directly (IE6 & IE7)
- // we need to manually fire the callback
- if ( !s.async || xhr.readyState === 4 ) {
+ if ( !s.async ) {
+ // if we're in sync mode we fire the callback
callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback, 0 );
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {