PDA

View Full Version : what is the best way to check if frame i done loading ?


frontline
09-18-2002, 09:22 AM
hello
im trying to check if some frame is done complete loading .
i tried something like this :
parent.SomeName.onreadystatechange=alert(parent.SomeName.readyState);
but its fire undefined.
i like to execute function when readyState='complete'
what im doing wrong here ? and is this method is the best?
p.s
i need it for IE only.

fivesidecube
09-18-2002, 12:12 PM
frontline,

I have the following suggestions,

Create a variable in the loading page that changes value via the pages onLoad method in the body tag. The page doing the monitoring can then:
1). check if the page exists
2). check that the variable exists
3). check the value of the variable
Only when the value of the varibale changes has the page loaded.

Another way would be for the loading page to call the function from its onLoad event in the <body> tag.

Hope this starts to help.

brothercake
09-18-2002, 12:46 PM
The onload event in the BODY tag of an IFRAME page will only fire for IE5.5 and IE6 - not IE5.0 The same applies to the readyState property.

I had a similair situation a while ago, and in the end I abandoned the IFRAME because of this very problem - sucking in the data server-side proved much less complex to implement.

Having said that, fivesidecube's idea of checking the existence of a variable in the IFRAME's document should work okay.