我用的是〈frame>框架,当我刷新的时候不要弹出对话筐,当我点击ie的关闭的时候时!弹出对话框!<html>
<head>
<title></title>
<script language="JavaScript"><!--
function confirmexit(){ 
event.returnValue="really exit?";
}
// --></script>
</head>
<body onbeforeunload="confirmexit();">
<form></form>
</body>
</html>用上面的话!我刷新时候也会弹出来!真麻烦!不想要的时候他就要

解决方案 »

  1.   

    用window.close()如果在对话框、框加中是会直接关闭的,不会提示什么,但在IE直接打开则会提示。
      

  2.   

    一开始也想到这个,不过,想想,一刷新就会有提示 :)
    <script>function window.onbeforeunload(){return "Are u sure?"}</script> 
    想了个折衷的办法.试试看吧 :)
    <script>
    function CloseOpen() {
    if(event.clientX<=0 && event.clientY<0) {
    if(!confirm("关闭窗口?"))window.open(document.URL);
    }
    else {
    //alert("notnew");
    }
    }
    </script>
    <body onunload="CloseOpen()">