Commit a2fc65fd authored by John Resig's avatar John Resig

From a suggestion by Diego, moved the jQuery.ready() call outside of the...

From a suggestion by Diego, moved the jQuery.ready() call outside of the try{}catch() block for IE/Safari DOM Ready.
parent 971840f3
...@@ -430,24 +430,20 @@ function bindReady(){ ...@@ -430,24 +430,20 @@ function bindReady(){
document.addEventListener( "DOMContentLoaded", jQuery.ready, false ); document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
// If Safari or IE is used // If Safari or IE is used
else { // Continually check to see if the document is ready
// Continually check to see if the document is ready else (function(){
function timer(){ try {
try { // If IE is used, use the trick by Diego Perini
// If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/
// http://javascript.nwbox.com/IEContentLoaded/ if ( jQuery.browser.msie || document.readyState != "loaded" && document.readyState != "complete" )
if ( jQuery.browser.msie || document.readyState != "loaded" && document.readyState != "complete" ) document.documentElement.doScroll("left");
document.documentElement.doScroll("left"); } catch( error ) {
return setTimeout( arguments.callee, 0 );
// and execute any waiting functions
jQuery.ready();
} catch( error ) {
setTimeout( timer, 0 );
}
} }
timer(); // and execute any waiting functions
} jQuery.ready();
})();
// A fallback to window.onload, that will always work // A fallback to window.onload, that will always work
jQuery.event.add( window, "load", jQuery.ready ); jQuery.event.add( window, "load", jQuery.ready );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment