window.close()问题
我在a.html使用 window.open()打开一个b.html窗口后 然后想关闭a.htlm
于是就在window.open()后加了句 window.close(); 但结果是 a b两个窗口全关掉了 怎么回事啊
或者哪位朋友能告诉我其他实现的方法
下面是全部代码
<html>
<head》
<title>My JSP 'success.jsp' starting page</title>
<script type="text/javascript">
function openMyWindow(url,name,iWidth,iHeight){
var url;
var name;
var iWidth;
var iHeight;
//获得窗口的垂直位置
var iTop = (window.screen.availHeight-30-iHeight)/2;
//获得窗口的水平位置
var iLeft = (window.screen.availWidth-10-iWidth)/2;
window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no');
window.close();
}
</script>
</head>
<body>
<script type="text/javascript">
window.onload =openMyWindow('/zhanxi/web/Booktree/index.jsp','openbooktree',1000,600);
</script>
</body>
</html>