Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

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.location.href = fileName;
    if (myRemote.opener == null) myRemote.opener = window;

<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'">

And then in popup.html:

<FRAME SRC="apage.html" NAME="frameName1">
<FRAME SRC="bpage.html" NAME="frameName2">

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

©2018 Martin Webb