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

Q1610 How do I refrence a JavaScript varible in an opener window from the popup window?

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

In the opener window:

<script language="JavaScript"><!--
var a_variable = 'Hello world';

var windowReference = window.open('popup.htm','windowName');

if (!windowReference.opener)
  windowReference.opener = this.window;
//--></script>

And then in popup.htm:

<script language="JavaScript"><!--
alert(opener.a_variable);
//--></script>

©2018 Martin Webb