Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q315 How do I change the content of a frame in another window?

You are here: irt.org | FAQ | JavaScript | Frame | Q315 [ previous next ]

The following works for me:

<SCRIPT LANGUAGE="JavaScript"><!--
function newWindow(fileName,windowName) {
    myRemote=window.open(fileName,windowName);
    myRemote.location.href = fileName;
    if (myRemote.opener == null) myRemote.opener = window;
}
//--></SCRIPT>

<FORM>
<INPUT TYPE="BUTTON" VALUE="Open Pop-Up Frame" onClick="newWindow('popup.html','control')">
<INPUT TYPE="BUTTON" VALUE="Load into frame 1" onClick="myRemote.frameName1.location.href='cpage.html'">
<INPUT TYPE="BUTTON" VALUE="Load into frame 2" onClick="myRemote.frameName2.location.href='cpage.html'">
</FORM>

And then in popup.html:

<FRAMESET ROWS="50%,*">
<FRAME SRC="apage.html" NAME="frameName1">
<FRAME SRC="bpage.html" NAME="frameName2">
</FRAMESET>

Feedback on 'Q315 How do I change the content of a frame in another window?'

©2018 Martin Webb