git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c43e1e3
)
Fixed the double-firing IE bug. (Ticket #13)
author
John Resig
<jeresig@gmail.com>
Sun, 18 Jun 2006 01:50:12 +0000
(
01:50
+0000)
committer
John Resig
<jeresig@gmail.com>
Sun, 18 Jun 2006 01:50:12 +0000
(
01:50
+0000)
event/event.js
patch
|
blob
|
history
diff --git
a/event/event.js
b/event/event.js
index
a78e1a9
..
fcd590a
100644
(file)
--- a/
event/event.js
+++ b/
event/event.js
@@
-46,12
+46,14
@@
$.$$ready = [];
// Handle when the DOM is ready
$.ready = function() {
// Handle when the DOM is ready
$.ready = function() {
- $.$$isReady = true;
- if ( $.$$ready ) {
- for ( var i = 0; i < $.$$ready.length; i++ ) {
- $.apply( document, $.$$ready[i] );
+ if ( !$.$$isReady ) {
+ $.$$isReady = true;
+ if ( $.$$ready ) {
+ for ( var i = 0; i < $.$$ready.length; i++ ) {
+ $.apply( document, $.$$ready[i] );
+ }
+ $.$$ready = [];
}
}
- $.$$ready = [];
}
};
}
};
@@
-82,7
+84,7
@@
if ( $.browser == "mozilla" || $.browser == "opera" ) {
// If Safari is used
} else if ( $.browser == "safari" ) {
$.$$timer = setInterval(function(){
// If Safari is used
} else if ( $.browser == "safari" ) {
$.$$timer = setInterval(function(){
- if ( document.readyState == "loaded" ||
+ if ( document.readyState == "loaded" ||
document.readyState == "complete" ) {
clearInterval( $.$$timer );
document.readyState == "complete" ) {
clearInterval( $.$$timer );