1, the implementation of JavaScript overload IFRAME page, compatible with the browser method
| The code is as follows |
Copy Code |
document.getElementById (Frameid). ContentWindow.location.reload (True);
|
2, the second is to get the elements within the IFRAME and apply
| The code is as follows |
Copy Code |
Iframe.contentWindow.document.getElementById (ID). style.display= "Block";
|
3,iframe page calls a function in the parent page
Parent.dofunction ();
Contentwindow instance
| The code is as follows |
Copy Code |
iframe = document.getElementById ("frame"); Iframe.contentWindow.location = "http://mozilla.org"; Iframe.contentWindow.history.back (); |
Reference
Http://www-archive.mozilla.org/docs/dom/domref/dom_frame_ref5.html
The Contentwindow property returns the Window object for the frame.
Syntax
| The code is as follows |
Copy Code |
FrameWindow = Frameelement.contentwindow
|
Parameters
FrameWindow is a object reference to the "Window object for this frame."
Example
| The code is as follows |
Copy Code |
f = document.getElementById ("frame");
F.contentwindow.location = "http://mozilla.org";
F.contentwindow.history.back ();
|
Notes
You can also get to the Window object through a named frame. For example, a frame with the name= "MyFrame" can refer back to the Window object as window.frames["MyFrame"].
Specification
DOM Level 2--htmlframeelement