How to open child window in another child windows's tab in javascript?
<p>I am struggling over here with a simple problem in javascript.<br>
what I want to do:<br>
1. open a popup(p1) from main page.<br>
2. open another popup(p2) from first popup(p1).<br>
3. now I want to open popup from p2 in p1's tab.<br>
I am using following code:<br></p>

<pre><code>var test = null;
// open first popup(p1) from main page
function openpopup1(URL,id) {
    test = eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=850,height=650,left = 520,top = 300');");
}

// open second popup(p2) from p1 popup
function openpopup2(URL,id){
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=300,left=650,top = 280');");
}

// now open popup into p1's tab from p2 popup
function openpopupTop1stab(){
    var newTab = window.open("tab.html");  
    window.test.opener(newTab); 
    // this code is not working
}
</code></pre>

<p>How can I solve this problem?</p>
