Firefox replacement for document.readyState complete?

P

Peter Michaux

Hi,

I am polling a frame from the parent window for readyState "complete".
Unfortunately Win/Firefox doesn't have readyState. I'm looking for
ways to deduce the same information. Maybe the document height hasn't
changed for one second would be a good indicator that the images are
loaded. A few crazy tricks like this would probably be good enough for
me. This is for an automated test suite and not for production code so
even navigator.useragent would be ok.

Does anyone know if there is some function that you can't call until
after the window.onload event? Maybe something that throws an error
before window.onload?

Any other ideas?

Thanks,
Peter
 
D

David Mark

Hi,

I am polling a frame from the parent window for readyState "complete".
Unfortunately Win/Firefox doesn't have readyState. I'm looking for
ways to deduce the same information. Maybe the document height hasn't
changed for one second would be a good indicator that the images are
loaded. A few crazy tricks like this would probably be good enough for
me. This is for an automated test suite and not for production code so
even navigator.useragent would be ok.

Does anyone know if there is some function that you can't call until
after the window.onload event? Maybe something that throws an error
before window.onload?

Once the DOM is ready, you can do anything, regardless of whether the
images, objects, etc. are still loading.

What are you trying to measure with this test?
 
T

Thomas 'PointedEars' Lahn

Peter said:
I am polling a frame from the parent window for readyState "complete".
Unfortunately Win/Firefox doesn't have readyState.

<body onload="...">
...
</body>

is the standard way to go and is supported both by IE and Geckos (incl.
Firefox).


PointedEars
 
P

Peter Michaux

Once the DOM is ready, you can do anything, regardless of whether the
images, objects, etc. are still loading.

What are you trying to measure with this test?

This is for an automated testing suite. A parent frame changes the URL
of a child frame. The parent frame needs to know when the child frame
is fully loaded. The page that is loading in the child frame cannot
make any communication to announce it is ready as that would require
that page's author to know about the testing framework. It would also
mean a lot of existing pages would need modification so they can be
tested.

Peter
 
E

Ed

This is for an automated testing suite. A parent frame changes the URL
of a child frame. The parent frame needs to know when the child frame
is fully loaded. The page that is loading in the child frame cannot
make any communication to announce it is ready as that would require
that page's author to know about the testing framework. It would also
mean a lot of existing pages would need modification so they can be
tested.

Peter

How about

<frame src="frame.html" onload="frame_load();">

This is nonstandard but it seems to work in Firefox.
 
T

Thomas 'PointedEars' Lahn

Ed said:
This is for an automated testing suite. A parent frame changes the URL
of a child frame. The parent frame needs to know when the child frame
is fully loaded. The page that is loading in the child frame cannot
make any communication to announce it is ready as that would require
that page's author to know about the testing framework. It would also
mean a lot of existing pages would need modification so they can be
tested.
[...]

How about

<frame src="frame.html" onload="frame_load();">

This is nonstandard but it seems to work in Firefox.

<frameset src="frame.html" onload="frame_load();">
...
</frameset>

is standard and may work, too.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top