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