Commit 5c7551e3 authored by John Resig's avatar John Resig

Fixed the double-firing IE bug. (Ticket #13)

parent c43e1e37
...@@ -46,12 +46,14 @@ $.$$ready = []; ...@@ -46,12 +46,14 @@ $.$$ready = [];
// Handle when the DOM is ready // Handle when the DOM is ready
$.ready = function() { $.ready = function() {
$.$$isReady = true; if ( !$.$$isReady ) {
if ( $.$$ready ) { $.$$isReady = true;
for ( var i = 0; i < $.$$ready.length; i++ ) { if ( $.$$ready ) {
$.apply( document, $.$$ready[i] ); for ( var i = 0; i < $.$$ready.length; i++ ) {
$.apply( document, $.$$ready[i] );
}
$.$$ready = [];
} }
$.$$ready = [];
} }
}; };
...@@ -82,7 +84,7 @@ if ( $.browser == "mozilla" || $.browser == "opera" ) { ...@@ -82,7 +84,7 @@ if ( $.browser == "mozilla" || $.browser == "opera" ) {
// If Safari is used // If Safari is used
} else if ( $.browser == "safari" ) { } else if ( $.browser == "safari" ) {
$.$$timer = setInterval(function(){ $.$$timer = setInterval(function(){
if ( document.readyState == "loaded" || if ( document.readyState == "loaded" ||
document.readyState == "complete" ) { document.readyState == "complete" ) {
clearInterval( $.$$timer ); clearInterval( $.$$timer );
......
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