Jump to content

document.readyState not available in Firefox


brucemand

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...