网页的主窗口自动关闭并弹出指定大小的窗口怎么实现?

来源:百度知道 编辑:UC知道 时间:2024/09/28 07:41:21
我想打开链接后自动关闭主窗口并弹出指定大小的窗口。在网上找了很多。都发现关闭主窗口时会有提示。好不容易弄到了这个。他可以实现
<script language="javascript">
function otherWindow()
{
window.opener=null;
window.open('b.htm');
window.close('');
}

</script>

<body onLoad="otherWindow();" >

但是我发现弹出的b.htm无法设置指定的大小。比如说没有工具栏和地址栏并设置为400*600的大小。

还请大家帮个忙。帮我把上面的代码补全。使他实现关闭后弹出的窗口为指定的大小!

<script language="javascript">
function otherWindow()
{
window.opener=null;
window.open('b.htm','','width=400,height=300');
window.close();
}
</script>
<body onLoad="otherWindow();" >

onClick="javascript:window.close;void(window.open('other.php','xx','width=400,height=600'));"