<script>
sub=null;
function check()
{
try
{
if(window.name=="newwin"||sub.name=="newwin")
alert("exist");
else
alert("not exist");
}
catch(e)
{
alert("not exist");
}
}
</script>
<input type=button value=open onclick='sub=window.open("","newwin","")'>
<input type=button value=close onclick='try{sub.close();}catch(e){}'>
<input type=button value=checkwin onclick=check()>
sub=null;
function check()
{
try
{
if(window.name=="newwin"||sub.name=="newwin")
alert("exist");
else
alert("not exist");
}
catch(e)
{
alert("not exist");
}
}
</script>
<input type=button value=open onclick='sub=window.open("","newwin","")'>
<input type=button value=close onclick='try{sub.close();}catch(e){}'>
<input type=button value=checkwin onclick=check()>
我该如何判断?或者说:
你将父窗口,刷新之后,就无法获得sub所指向的窗口了,
即使sub窗口打开着,也无法正常判断.