Jump to content

document.readyState not available in Firefox


brucemand
 Share

Recommended Posts

i've happened to glance through some AJAX documentation and am aware that there are other objects (HTTP-Request-thingy) that allow for finding out the "ready state" in other ways, but just for the sake of 'fully loaded' or not, would the onload = true be a sufficient alternative ?meaning; in the scenario below;

<html><head><script>function displayok() {var showall=document.getElementsByTagName('img');showall[0].style.display="inline";showall[1].style.display="none";}</script></head><body onload="displayok()"><img src="HUGE_PIC.jpg" style="display:none"><img src="loading.gif"></body></html>

the HUGE_PIC will not be shown until the document is fully loaded ?

Link to comment
Share on other sites

Firefox can tell when the document using the DOMContentLoaded event:

window.addEventListener("DOMContentLoaded",displayok,false);

Only standard compliant browsers have this event and it can only be used with the addEventListener method.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...