mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #10895. Reduce IE poll interval to save CPU time.
This commit is contained in:
parent
375c44d9c7
commit
9cbe375a55
@ -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 );
|
||||||
@ -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
|
||||||
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user