X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fevent.js;h=47758665e95b570aec8ecaa2fa0d9664cd2a453a;hb=beebbf8ba44655f2f90750f727ef9cbdfe152f1c;hp=99778f8d85d5e2d48ed36ea5d09dfae949441914;hpb=1344a7fd503054299442c3463a0e311729f8229a;p=jquery.git diff --git a/src/event.js b/src/event.js index 99778f8..4775866 100644 --- a/src/event.js +++ b/src/event.js @@ -429,9 +429,9 @@ function bindReady(){ document.addEventListener( "DOMContentLoaded", jQuery.ready, false ); // If Safari or IE is used - else + else { // Continually check to see if the document is ready - (function timer() { + function timer(){ try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ @@ -443,7 +443,10 @@ function bindReady(){ } catch( error ) { setTimeout( timer, 0 ); } - })(); + } + + timer(); + } // A fallback to window.onload, that will always work jQuery.event.add( window, "load", jQuery.ready );