06-18-2002, 10:30 PM
Is there a way to determine if a page has loaded completely?
Also is there a way to determine if items on a page have also completely loaded?
06-18-2002, 10:36 PM
what do you need?
alert('The page has loaded completely!');
That'll do it.
06-18-2002, 10:38 PM
I assumed that the onload is the 1st event that occurs; I want to make sure that the page has rendered completely...can this be captured?
06-18-2002, 10:40 PM
If the onLoad event has fired, the page has completed loading...
what more do you need?
Please explain in details what you're trying to accomplish
06-18-2002, 10:40 PM
I want to know if specific elements are loaded....
06-18-2002, 10:42 PM
I do not think this is possible - specific elements .. such as a picture?
06-18-2002, 10:43 PM
Does the complete method work for all objects?
06-18-2002, 10:45 PM
Never heard of that...
sorry Krazy, you gotta give me credit though, I did answer your first question... :D
06-18-2002, 10:50 PM
Yup you are correct!
You did answer the 1st one!! Thanks...sorry for not explaining my questions as refined as possible...if there is such a method to determine if specific elements have loaded I would like to know...
Thanks again QuackHead!
06-18-2002, 11:01 PM
I think what you are referring to is the readyState property. In IE4+ you should be able to refernece the readySate property like so:
var x= document.readyState
which should return 1 of 5 different values:
so to see if a element is in fact completely loaded you could use:
which will return true or false depending on the current readySate of that image.
06-18-2002, 11:04 PM
Thanks for the info JohnKrutsch!
Is there an NS equivalent for the readyState?
06-18-2002, 11:15 PM
06-18-2002, 11:21 PM
Well, I was thinking if you were to need this event for dynamically creating objects; I suppose that if this method is only for images...
06-19-2002, 07:42 PM
Tis should work although I download the picture so fast I can't see if it works.
<div id="stats"> </div>
<img name="pic" src="http://home.centurytel.net/jcjoel2002/shed.jpg" width="640" height="480" />
var x= document.images.pic.readyState;
06-19-2002, 09:37 PM
My cent in.
As far as images are concerned, they are respondent to onLoad <img src.... onLoad="">
if you know how many images in a page are or how many are chached for rollovers (I bet this might be one of the underlying problems), you can instruct each image to run a function upon being loaded:
then each image <img ... onLoad="addF()">
and for prechached you may try:
var anImm=new Image(100,100)
To know if a page has loaded all its graphical elements then, you recursively check with a timeout until
finish= your amount of images
maybe it is an adjunctive hint for your problem
06-26-2002, 11:16 PM
I was reading this and added the following to my page to see the readystate and it returns loading.
Would this explain why the onload would not work..........
When does it become a loaded state.