]> source.dussan.org Git - jquery.git/commitdiff
When IE6 & IE7 serve from the cache in async mode, resolves the request asynchronousl...
authorjaubourg <j@ubourg.net>
Wed, 16 May 2012 21:43:16 +0000 (23:43 +0200)
committerjaubourg <j@ubourg.net>
Wed, 16 May 2012 21:43:16 +0000 (23:43 +0200)
src/ajax/xhr.js

index 013863d4eed18b40af331ffaff0406763fe93e7f..186432f61de6882a754a752ac9ba46b7d387314c 100644 (file)
@@ -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 ) {