Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: Cannot Access FRAMES Collection of Element Behavior


View products that this article applies to.

This article was previously published under Q257353

↑ Back to the top


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".

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


References

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

↑ Back to the top


Keywords: KB257353, kbdhtml, kbbug

↑ Back to the top

Article Info
Article ID : 257353
Revision : 4
Created on : 5/11/2006
Published on : 5/11/2006
Exists online : False
Views : 291