I?ve succeeded to get a reference to opened window in the following way:
code:
<HTML>
<SCRIPT language="javascript">
//var _oChildWin = null;
function doOpen(){
window.open('http://www.yahoo.com', 'newWin');
}
var oChildWin = null;
function doClose(){
try{
oChildWin.close();
} catch(e){}
}
function doCatch(){
try{
oChildWin = window.open('', 'newWin');
} catch(e){}
}
</SCRIPT>
<BODY>
<input type="button" value="Open window by name" onClick="doOpen()">
<input type="button" value="Get window reference by name" onClick="doCatch()">
<input type="button" value="Close opened window" onClick="doClose()">
</BODY>
</HTML>
Anyone knows how to avoid the window from open a new instance in case the window not exists (by name)?
Regards,
Yossi Admon
[This message has been edited by Yossi Admon (edited 01-20-2004).]