ie、chrome、360:
页面加载时执行unload();
刷新时先执行onbeforeload(),新页面即将替换旧页面时onunload(),最后unload();
关闭时执行onbeforeload(),再执行onunload().
firefox:
刷新时只执行onunload();
关闭时只执行onbeforeunload()
window.onbeforeunload=function(e){
var e = window.event||e;
e.returnValue=("确定离开当前页面吗?");
}