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

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?

irt.org | Knowledge Base | JavaScript | Window | Q349 [ previous next ]

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?

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>

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.