有没有一种方法可以取消javascript事件
onbeforeunload
,并只让它执行一个函数然后返回到页面?window.onbeforeunload = function(){
//execute some logic
return false;
}