Microsoft KB Archive/257353

= BUG: Cannot Access FRAMES Collection of Element Behavior =

Article ID: 257353

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q257353



SYMPTOMS
Any attempt to reference the FRAMES collection from within an element behavior results in the appearance of an error dialog box with the message "Not Implemented".



RESOLUTION
To work around this problem, you can access frame objects through the document.all collection instead of through the frames collection. If you want to access the contents of the IFRAME (when it is in the same domain), you can use document.name.contentWindow.document to obtain the document object.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
  Copy the following code into a file named Test.htm:  <?import namespace=ie implementation=test.htc>

 Original



   Copy the following code into a file named Test.htc:  <public:attach event="oncontentready" onevent=Doc_Ready />

<SCRIPT> function Doc_Ready { defaults.viewLink = document; alert(document.frames.ifrm1.name); } </SCRIPT>

<IFRAME name="ifrm1" SRC="blank.htm"></IFRAME></IFRAME>

</PUBLIC:COMPONENT> </li>  Create a file named Iframe.htm with the following HTML: 

 <DIV> Text contained within an IFRAME. </DIV> </BODY>

</HTML> </li> Run Test.htm within Internet Explorer 5.5.</li></ol>

Note that if you replace this line in Test.htc alert(document.frames.ifrm1.name); with this line alert(document.all.ifrm1.name); the behavior will work as expected.

<div class="references_section">