Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Frame | Q315 [ previous next ]

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

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


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.