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

Q349 How can a button in a popup window, change the main window so that the current page in the main window is reloaded into a frameset?

You are here: irt.org | FAQ | JavaScript | Window | Q349 [ previous next ]

Are all these pages on the same server? If not then no - as one file on one server cannot get the details of another file from another server. If its a file from the same server, then you might try the following:

In the popup window:

<SCRIPT LANGUAGE="JavaScript"><!--
function DoMagicalStuff() {
    opener.location.href = 'magic.htm' + '?' + escape(opener.top.info.location);
}
//--></SCRIPT>

<FORM>
<INPUT TYPE="BUTTON" onClick="DoMagicalStuff()">
</FORM>

And then in magic.htm:

<HTML>
<SCRIPT LANGUAGE="JavaScript"><!--
document.write('<FRAMESET COLS="50%,50%">');
document.write('<FRAME SRC="apage.htm">');
document.write('<FRAME SRC="' + unescape(location.search.substring(1)) + '">');
document.write('<\/FRAMESET>');
//--></SCRIPT>
</HTML>

©2018 Martin Webb