Skip to content

Commit

Permalink
Fix #10895. Reduce IE poll interval to save CPU time.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmethvin committed Jun 26, 2012
1 parent 375c44d commit 9cbe375
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ jQuery.ready.promise = function( object ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready // Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout( jQuery.ready, 1 ); setTimeout( jQuery.ready, 1 );


// Mozilla, Opera and webkit nightlies currently support this event // Standards-based browsers support DOMContentLoaded
} else if ( document.addEventListener ) { } else if ( document.addEventListener ) {
// Use the handy event callback // Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
Expand All @@ -833,8 +833,7 @@ jQuery.ready.promise = function( object ) {


// If IE event model is used // If IE event model is used
} else { } else {
// ensure firing before onload, // Ensure firing before onload, maybe late but safe also for iframes
// maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", DOMContentLoaded ); document.attachEvent( "onreadystatechange", DOMContentLoaded );


// A fallback to window.onload, that will always work // A fallback to window.onload, that will always work
Expand All @@ -857,7 +856,7 @@ jQuery.ready.promise = function( object ) {
// http://javascript.nwbox.com/IEContentLoaded/ // http://javascript.nwbox.com/IEContentLoaded/
top.doScroll("left"); top.doScroll("left");
} catch(e) { } catch(e) {
return setTimeout( doScrollCheck, 1 ); return setTimeout( doScrollCheck, 50 );
} }


// and execute any waiting functions // and execute any waiting functions
Expand Down

0 comments on commit 9cbe375

Please sign in to comment.