From beebbf8ba44655f2f90750f727ef9cbdfe152f1c Mon Sep 17 00:00:00 2001 From: John Resig Date: Mon, 1 Oct 2007 14:14:09 +0000 Subject: [PATCH] Safari 2 was having problems with the syntax used for the ready handling. --- src/event.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/event.js b/src/event.js index 99778f8d8..47758665e 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 ); -- 2.39.5