<script type="text/javascript">
<!--
function openWindow()
{
secondWin= open('./window_pop.html','example',
'height=300,width=200,scrollbars=yes');
}
//-->
</script>
<form action="#" method="get">
<input type="button" value="Open Window" οnclick="openWindow();" />
<input type="button" value="Close Window" οnclick="if (window.secondWin)
secondWin.close();" />
<input type="button" value="Check Status" οnclick="if (window.secondWin)
alert(secondWin.closed); else alert('secondWin undefined');" />
我是父窗口的数据:<input id='opener_text' name='opener_text' >
<input type='button' value='取得打开窗口的数据' οnclick='alert(secondWin.document.all.newWin_text.value)'>
</form>
打开和关闭窗口以及窗口间的数据传递
最新推荐文章于 2022-10-24 15:07:58 发布