点击IE关闭按钮时,想弹出个只有"是否要退出系统?"这几个字的提示框.我在网上找了些相关代码,但提示除了想要说的内容外,还会有一些,IE自带的提示话语,"确定要离开此页面 点'确定'继续,或按'取消'留在当前页面."由于需求问题这段话不能加.以下这段代码会出现如上问题!
<script language="javascript">
g_blnCheckUnload = true;
function RunOnBeforeUnload() {
if (g_blnCheckUnload)
{//注意异常的捕获
try{
window.event.returnValue = ’You will lose any unsaved content’;
}catch(e){}
} }
</script>
<body onbeforeunload="RunOnBeforeUnload()">
</body>
<script language="javascript">
g_blnCheckUnload = true;
function RunOnBeforeUnload() {
if (g_blnCheckUnload)
{//注意异常的捕获
try{
window.event.returnValue = ’You will lose any unsaved content’;
}catch(e){}
} }
</script>
<body onbeforeunload="RunOnBeforeUnload()">
</body>
http://topic.csdn.net/t/20040907/10/3347299.html
<html>
<head>
<script language="javascript">
function unloadCancel()
{
if(!confirm("确定要退出此页面吗?"))
return;
}
</script>
</head>
<body onbeforeunload="unloadCancel();">
</body>
</html>
window.event.returnValue = “是否要退出系统?";
}
window.onbeforeunload=exit;