<script>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
//加自己的函数.
window.event.returnValue="确定要退出本页吗?";
}else
{
alert("你在刷新");
//return false;
}
}
</script>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
//加自己的函数.
window.event.returnValue="确定要退出本页吗?";
}else
{
alert("你在刷新");
//return false;
}
}
</script>
我知道用onbeforeunload啊!我哪段代码就是在onbeforeunload中写的
关键的问题是
window.event.returnValue="确定要退出本页吗?";
这句话之后,要不然直接关闭了本页,要不然就不动
我想要的效果是
关闭的时候,显示提示信息 "关闭本页的时候,是否退出系统"
如果选择“是”,则本页在定向到一个页面(用来注销系统)
否则(选择“否”),只关闭本页,而不调用注销页面!!
各位大虾在帮忙想想办法!谢谢!