How does one support hierarchical calling between frames and firefox?

Source: Internet
Author: User
When this problem occurs,
I have a page of main.html with many frameworks, such as a.html, B .html, c.html, d.html, and e.html...
These subpages contain a MenuButtonClass () method with the same name as javascript.
In one of the Child pages, I will handle other frames.

Window. parent. frames (x). MenuButtonClass ();

This code has no problem in IE, but it is wrong in firefox!

Later, I wrote the example parent.doc ument. getElementsByTagName ("frame") [x]. MenuButtonClass ();

But still error. Why? I adjusted and found
Extends extends parent.doc ument. getElementsByTagName ("frame") [x] is an object
Isn't there anything else to write?

I finally found the cause today. There were only a few contentWindow attributes.
The example should be written as follows: Upload parent.doc ument. getElementsByTagName ("frame") [x]. contentWindow. MenuButtonClass ();

In this way, it is no problem to support IE and firefox.
Attached sample code
Window example. rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.