From a suggestion by Diego, moved the jQuery.ready() call outside of the try{}catch() block for IE/Safari DOM Ready.
This commit is contained in:
parent
971840f343
commit
a2fc65fd32
14
src/event.js
14
src/event.js
|
@ -430,24 +430,20 @@ function bindReady(){
|
|||
document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
|
||||
|
||||
// If Safari or IE is used
|
||||
else {
|
||||
// Continually check to see if the document is ready
|
||||
function timer(){
|
||||
else (function(){
|
||||
try {
|
||||
// If IE is used, use the trick by Diego Perini
|
||||
// http://javascript.nwbox.com/IEContentLoaded/
|
||||
if ( jQuery.browser.msie || document.readyState != "loaded" && document.readyState != "complete" )
|
||||
document.documentElement.doScroll("left");
|
||||
} catch( error ) {
|
||||
return setTimeout( arguments.callee, 0 );
|
||||
}
|
||||
|
||||
// and execute any waiting functions
|
||||
jQuery.ready();
|
||||
} catch( error ) {
|
||||
setTimeout( timer, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
timer();
|
||||
}
|
||||
})();
|
||||
|
||||
// A fallback to window.onload, that will always work
|
||||
jQuery.event.add( window, "load", jQuery.ready );
|
||||
|
|
Loading…
Reference in a new issue