<script>
if(!opener){
window.open(location,'','toolbar=no,status=no,scrollbars=no,menubar=no,location=no')
location='error.htm'
//if ie5.5+,use window.opener=null;window.close()
}
</script>
if(!opener){
window.open(location,'','toolbar=no,status=no,scrollbars=no,menubar=no,location=no')
location='error.htm'
//if ie5.5+,use window.opener=null;window.close()
}
</script>
不过,我试过你的代码,只是用window.open来打一个没有toolbar,status,scrollbars,menubar,location而已,未能自动关闭调用window.open的那个window.我想实现的目标是这样的:
当前的window中(也就是当前的IE)其地址栏为first.php,当我提交数据给second.php后,它就在当前的IE中显示出来,并且去掉所面上说的东西如果这个不能实现,又或者这样:
可不可以在当前的window中(也就是当前的IE)其地址栏为first.php,提交数据,之后新开一个window(这个window可去掉所面上说的东西),并自动关闭first.php那个window可以吗?
2.try:
<form action='second.php' method=post target='newWin' onsubmit="window.open('','newWin','toolbar=no,menubar=no')">in second.php
<body onload="window.opener.opener=null;window.opener.close()">just for ie5.5+ or higher
http://www.csdn.net/develop/Read_Article.asp?Id=19170