onunload, onbeforeunload在不同浏览器中的情况

//对于ie,谷歌,360:

//页面加载时只执行onload
//页面刷新时,刷新之前执行onbeforeunload事件,在新页面即将替换旧页面时onunload事件,最后onload事件。
//页面关闭时,先onbeforeunload事件,再onunload事件。

//对于火狐:

//页面刷新时,只执行onunload;页面关闭时,只执行onbeforeunload事件

https://stackoverflow.com/questions/568977/identifying-between-refresh-and-close-browser-actions

猜你喜欢

转载自blog.csdn.net/liduanwh/article/details/84777606
今日推荐