window.onunload=function(){

//可以阻止浏览器的刷新或者关闭

     return false;

 }

window.onbeforeunload=function(){

//可以阻止浏览器的刷新或者关闭

    return false;

}

 

window.onclose貌似不会触发浏览器关闭事件。。。

 

参考:

http://blog.sina.com.cn/s/blog_995c1f630101a9el.html

http://www.dslreports.com/forum/r11684650-window-onclose-vs-window-onunload

相关文章:

  • 2022-12-23
  • 2021-11-09
  • 2021-10-09
  • 2021-12-06
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
猜你喜欢
  • 2022-01-19
  • 2022-12-23
  • 2021-04-10
  • 2021-11-30
  • 2022-01-25
  • 2022-12-23
相关资源
相似解决方案