PRB: document.readyState Not in Sync with Download in IFrameID: Q188763
|
When you insert an IFrame using insertAdjacentHTML, the readyState is not in sync with the download of the document in the new IFrame. If you check the value of document.readyState immediately after the insertAdjacentHTML, the readyState is set to complete, even though the document in the IFrame has not finished loading.
The behavior is by design. Once a document goes readystate complete, Internet Explorer does not fire onreadystatechange again.
<HTML>
<HEAD>
<TITLE>IFrame/readyState Bug</TITLE>
<SCRIPT LANGUAGE="VBScript">
Sub btn_onClick
document.body.insertAdjacentHTML "BeforeEnd", _
"<IFRAME SRC='http://www.microsoft.com'></IFRAME>"
MsgBox "ReadyState: " + document.readyState
End Sub
</SCRIPT>
</HEAD>
<BODY>
<BUTTON ID="btn">Insert IFrame</BUTTON>
</BODY>
</HTML>
For more information, please see the MSDN Web Workshop:
http://msdn.microsoft.com/workshop/default.asp
Additional query words:
Keywords : kbnokeyword kbIE401 kbIE401sp1 kbIE500dp1 kbIE500
Version :
Platform :
Issue type : kbprb
Last Reviewed: May 7, 1999