PRB: OnReadyStateChange and OnLoad Events Not Fired for an IFrame

ID: Q239638


The information in this article applies to:
  • Microsoft Internet Explorer (Programming) versions 4.0, 4.01, 4.01 SP1, 4.01 SP2, 5


SYMPTOMS

Documentation mentions that OnReadyStateChange and OnLoad events fire for IFRAME. But the event handler for these events never gets called. This article specifically discusses IFRAME but the information is applicable for FRAME and FRAMESET as well.


CAUSE

These events are fired in the context of the document object model of the IFRAME and not in the parent's object model. By the time the IFRAME is loaded, the above events are already fired and ReadyState is complete. You cannot rely on the above property to test whether an IFRAME is loaded.


STATUS

This behavior is by design in the versions of Internet Explorer listed at the beginning of the article.


MORE INFORMATION

There is no good way to find out if an IFRAME is loaded from its parent.

The best workaround might be to have the IFRAME access the parent once it is loaded instead of the parent trying to access the IFRAME.

The browser could also try accessing the IFRAME using try-catch error handling of JavaScript with a timer if the Microsoft Scripting Engines Version 5.0 is installed.


REFERENCES

Microsoft Windows Scripting Technologies

For additional information, please click the article number below to view the article in the Microsoft Knowledge Base:

Q188763 PRB: document.readyState Not in Sync with Download in IFrame

Additional query words: IFRAME onReadyStateChange ReadyState onload

Keywords : kbDHTML kbGrpInet kbDSupport kbIEFAQ
Version : WINDOWS:4.0,4.01,4.01 SP1,4.01 SP2,5
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: January 27, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.