I have a web page that opens multiple pop up windows using window.open(). I need the pop up windows to be able to close one another using their names.
Example:
testwin = window.open('','win_1');
testwin.document.write('<a href="#" onclick="win_2.close();win_3.close();">Click Me</a>');
testwin2 = window.open('','win_2');
testwin.document.write('<a href="#" onclick="win_1.close();win_3.close();">Click Me</a>');
testwin3 = window.open('','win_3');
testwin.document.write('<a href="#" onclick="win_1.close();win_2.close();">Click Me</a>');
The onclicks always come up with "win_test3 is undefined"
Please help! Thanks
Example:
testwin = window.open('','win_1');
testwin.document.write('<a href="#" onclick="win_2.close();win_3.close();">Click Me</a>');
testwin2 = window.open('','win_2');
testwin.document.write('<a href="#" onclick="win_1.close();win_3.close();">Click Me</a>');
testwin3 = window.open('','win_3');
testwin.document.write('<a href="#" onclick="win_1.close();win_2.close();">Click Me</a>');
The onclicks always come up with "win_test3 is undefined"
Please help! Thanks