<html>
<head>
<title>New Page 1</title>
</head>
<body>
<script language="JavaScript">
<!--
function CloseWin()
{
window.opener
=null;
window.open(
'','_self');
window.close();
}
//-->
</script>
<input type=button value=关闭 onclick="CloseWin()">
</body>
</html>


注:
Firefox(火狐)浏览器需要将“dom.allow_scripts_to_close_windows”属性设置为“true”。
在火狐地址栏输入:about:config,进入高级配置界面,找到项“dom.allow_scripts_to_close_windows”,双击,更改为“true”即可。


相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2021-11-19
  • 2021-05-20
  • 2022-01-06
  • 2022-02-06
  • 2021-12-25
猜你喜欢
  • 2021-10-30
  • 2022-12-23
  • 2021-12-16
  • 2022-03-06
  • 2022-02-27
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案