Commit 9b7bbc61 authored by John Resig's avatar John Resig

DOMContentLoaded works in Opera 9b2+, so I have it firing for that now too -...

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)
parent 66bd98be
...@@ -56,7 +56,7 @@ $.ready = function() { ...@@ -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" ) { ...@@ -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" ) {
......
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