一般的WEB系统都有个退出的按钮,意思是点击后直接关闭窗口,从而达到退出系统的目的
但按照常规的写法,关闭之前总是会弹出个提示,询问是否确定要关闭窗口
本文的目的就是取消这个弹出提示

先看这行代码:


1 <input type="button" value="退出系统" onclick="closeWin()" />

 

正常情况下,执行关闭窗口的closeWin()函数:


1 function closeWin(){   
2     window.close();   
3 }  


不弹出提示的写法:


1 function closeWin(){   
2     parent.window.opener = null;   
3     parent.window.open("""_self");   
4     parent.window.close();   
5     parent.window.location.href = "";   
6     window.close();   
7 }

 

相关文章:

  • 2021-12-18
  • 2021-12-21
  • 2021-08-03
  • 2021-10-25
  • 2021-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案