diff options
author | jaubourg <j@ubourg.net> | 2012-05-16 23:43:16 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-05-16 23:43:16 +0200 |
commit | d55a764e6e3a5980fb9633df1303418bcb512327 (patch) | |
tree | 9823accea4c73e22143a33a7b2784c9a01f253a5 /src/ajax/xhr.js | |
parent | 9efe4d03df7ce417792152660a0bed36b261676e (diff) | |
download | jquery-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/ajax/xhr.js')
-rw-r--r-- | src/ajax/xhr.js | 10 |
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 ) { |