mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
DOMContentLoaded works in Opera 9b2+, so I have it firing for that now too - the means that there is a DOM Ready solution for every major browser! (Older version of Opera simply fallback to window.onload)
This commit is contained in:
parent
66bd98be22
commit
9b7bbc619b
@ -56,7 +56,7 @@ $.ready = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// If Mozilla is used
|
// If Mozilla is used
|
||||||
if ( $.browser == "mozilla" ) {
|
if ( $.browser == "mozilla" || $.browser == "opera" ) {
|
||||||
// Use the handy event callback
|
// Use the handy event callback
|
||||||
document.addEventListener( "DOMContentLoaded", $.ready, null );
|
document.addEventListener( "DOMContentLoaded", $.ready, null );
|
||||||
|
|
||||||
@ -79,8 +79,8 @@ if ( $.browser == "mozilla" ) {
|
|||||||
// Clear from memory
|
// Clear from memory
|
||||||
script = null;
|
script = null;
|
||||||
|
|
||||||
// If Safari or Opera is used
|
// If Safari is used
|
||||||
} else {
|
} else if ( $.browser == "safari" ) {
|
||||||
$.$$timer = setInterval(function(){
|
$.$$timer = setInterval(function(){
|
||||||
if ( document.readyState == "loaded" ||
|
if ( document.readyState == "loaded" ||
|
||||||
document.readyState == "complete" ) {
|
document.readyState == "complete" ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user