有时在页面的刷新会触发 window.onbeforeunload()事件,只要加一个判断就可以了。
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";
}
有时在页面的刷新会触发 window.onbeforeunload()事件,只要加一个判断就可以了。
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";
}
转载于:https://www.cnblogs.com/jkswjw/archive/2008/07/21/1247990.html