点击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>
document.body.onunload = function()
{}
document.body.onunload = function()
{
if(confirm("确定要离开?"))
{
}
}
if(eventClientX<0 && eventClientY<0)
{
}