1. 不带任何提示关闭窗口的js代码

<a href="javascript:window.opener=null;window.open('','_self');window.close();">关闭</a>

  

2. 自定义提示关闭

function custom_close() {

    if (confirm("您确定要关闭本页吗?")) {
      window.opener=null;
      window.open('','_self');
      window.close();
   }

}

  

<body onbeforeunload="return '真的要关闭此窗口吗?'">

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-02-11
  • 2022-01-10
  • 2021-08-19
  • 2021-08-22
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2021-12-22
  • 2021-12-02
  • 2021-12-03
  • 2021-06-21
相关资源
相似解决方案