你这样写.<script for=window event=onbeforeunload>
if (event.clientX>document.body.clientWidth &&event.clientY<0||event.altKey)
return("确实要关闭窗口?")
</script>
if (event.clientX>document.body.clientWidth &&event.clientY<0||event.altKey)
return("确实要关闭窗口?")
</script>
onunload在窗口unload时触发
onbeforeunload在窗口unload前触发
<BODY onbeforeunload="event.returnValue='Are you sure to exit the current page?'">
<P>Navigate to another page to fire the before unload event.
</BODY>