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

最新文章

  1. python实验一:画图
  2. EVE ToDo
  3. POJ 1743 后缀数组
  4. Codeforces Round #184 (Div. 2) E. Playing with String(博弈)
  5. Android的四大组件
  6. ASP.NET MVC Error
  7. 富有魅力的git stash
  8. Python prettytable的使用方法
  9. JAVA多线程解惑之多线程返回值
  10. Unity Navigation自动寻路
  11. fastjson的常用使用方法
  12. Javascript实例技巧精选(7)—设置和获取文本框与文本域的光标位置(兼容IE和Chrome,Firefox)
  13. iOS开发—— UIImagePickerController获取相册和拍照
  14. 【BZOJ2004】公交线路(动态规划,状态压缩,矩阵快速幂)
  15. 第十课html5 新增标签及属性 html5学习5
  16. 异步请求取得json数据
  17. 75.iOS内存管理
  18. [HDU4906]Our happy ending
  19. windows Server 2008 R2 TFS2010的备份
  20. django 同步数据库出现 No changes detected 的可能原因

热门文章

  1. Cocos2d-x粒子系统
  2. [转]FPGA网站推荐
  3. hibernate出现 org.hibernate.PropertyNotFoundException: field [departmen] not found on cn.itcast.hibernate.domain.Employee1错误
  4. c 字符串 函数
  5. 概率dp HDU 4405
  6. Xcode iphone模拟器运行不流畅
  7. 《Java设计模式》之构建者模式
  8. Unix高级环境编程—进程控制(一)
  9. vue element-ui 自动获取光标
  10. MethodDispatcher—Cherrypy对REST的支持