Can I access a variable in the child window
<p>I'm trying to access a variable in a window that I have opened.</p>

<p>Here is the parent window, it opens up a new window, sets a reference to the child window and then in another onclick event it attempts to retrieve a variable defined in the child window.</p>

<pre><code>    var window1;

    //open a window
    $('#btnOpen').click(function () {
        window1 = window.open('openedwindow', 'window2');
    });

    //get child variable
    $('#btnGetChildVariable').click(function () {
        alert(window1.childVariable);
    });
</code></pre>

<p>here is the code in the child window</p>

<pre><code>    var childVariable = 'My child';
</code></pre>

<p>Is this possible?  is window1.childVariable correct syntax, currently it just returns undefined (there is no unsafe javascript error and I've tried it to get at a control in the child window and I can access it).  Page 358 of Javascript the Definitive guide seems to suggest this is possible.</p>
