Skip to content
Permalink
Browse files

Safari 2 was having problems with the syntax used for the ready handl…

…ing.
  • Loading branch information
jeresig committed Oct 1, 2007
1 parent 1344a7f commit beebbf8ba44655f2f90750f727ef9cbdfe152f1c
Showing with 6 additions and 3 deletions.
  1. +6 −3 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 );

0 comments on commit beebbf8

Please sign in to comment.
You can’t perform that action at this time.