About Us

Working with iframes involves referencing two very different objects: the iframe element, and the window generated by the iframe which contains the document loaded into it. Cross-browser cooperation is more likely if you set both the id and name attributes, applying the same value to both for simplicity.

To obtain references to these two elements you can choose between two methods: using the frames array (DOM Level 0) versus newer methods - some standard, some proprietary. See specifics below. If you want to use the frames array referencing method, the name attribute is required.

Most browsers in current use support an iframe onload attribute (includeing IE5.5+, Firefox, Safari, Opera). If you want older browsers to do something once the document has finished loading into the iframe, you can include an onload handler inside that document.

Access Denied Error: An error of access denied or permission denied will be triggered if you try to access properties of the document loaded into the iframe or its window if that document is from another domain. The document.domain property can be set to ease the restriction somewhat. For example, if a document at www.example.com wants to communicate with a document at forums.example.com, the document.domain property could be set to example.com in both documents to allow JavaScript interaction between them.

Premium
Sponsors
LATEST
SCRIPTS.
MOST
POPULAR SCRIPTS.
MOST
ACTIVE USERS.
Copyright 2008 Scriptroad.com All Right Reserved.
Design, images & stylesheet may not be resued without permission.
This site has been tested with DTD XHTML 1.0 Strict & CSS 3.
This work is licensed under a Creative Commons Attribution Noncommercial-No derivative Works 3.0 United States License.