Call the AAA function in the parent
Sub-page:
Onclick= "Window.parent.frames.aaa ()"
In the parent page:
function aaa ()
{
alert (' bbbbb ');
}
The pages in frame frames should be changed to other pages in the frame or the parent frame with parent
Window.opener refers to the parent page of the window.open open page.
The Window.frames object can refer to the page in the IFRAME, or to the page in the frameset.
Can do this
Window.frames[0].document.getelementbyid (' xx ');
Can do this
window.frames[0].document.body.innerhtml;
frm = window.parent.window.frames[' uploadframe '];
Frmdocument = frm.document;
FRM.SB (3); SB is a function in the Uploadframe page
For Firefox
If you encounter an error: Parent.document.frames has no properties
Replace it with the following code, this code is IE,FF compatible. frm = window.parent.window.frames[' uploadframe '; in fact, the frames collection is not hanging in the document but hanging under the Window object.
Note that there is a limit to the page in the frame, which must be under the same domain, otherwise inaccessible
If it is under the same domain, but the sub domain name is different, then the js,html file involved adds a sentence.
Document.domain = xxx.com [fill in your domain name here]
document.getElementById (' Iframeid '). ContentWindow.document.getElementById (' Someelementid ');
Call parent page function after JS window page
(For example: Invoke parent page Function test2 ())
Window.opener.test2 ();
Frame subpage calls the previous page method
(For example: the frame frame named menubar on the previous page, call the Onhook () function)
window.top.frames["MenuBar"].onhook ();
JS window page Call parent page Frame Child page function
(such as: Play Window page call, frame named menubar)
window.opener.top.frames[' MenuBar '].onhook ();
The above is small series for everyone to bring JS call the parent frame function and the window to call the parent page function of the simple method of all the content, I hope that we support cloud-Habitat Community ~