BUG: Cannot Access FRAMES Collection of Element Behavior (257353)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Copy the following code into a file named Test.htm:
    <HTML xmlns:ie>
    <?import namespace=ie implementation=test.htc>
    
    <BODY>
    <ie:abc>Original</ie:abc>
    
    </BODY>
    
    </HTML>
    					
  2. Copy the following code into a file named Test.htc:
    <public:component tagName=abc>
        <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>
    					
  3. Create a file named Iframe.htm with the following HTML:
    <HTML>
    
    <BODY>
    <DIV>
    Text contained within an IFRAME.
    </DIV>
    </BODY>
    
    </HTML>
    					
  4. Run Test.htm within Internet Explorer 5.5.

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.

REFERENCES

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbBug kbDHTML KB257353