你这样写.<script for=window event=onbeforeunload> 
if (event.clientX>document.body.clientWidth &&event.clientY<0||event.altKey) 
return("确实要关闭窗口?") 
</script>

解决方案 »

  1.   

    <body onbeforeunload="return '你即将关闭本窗口,请确认是否已经保存所有操作!\n选择〖确定〗关闭窗口,或选择〖取消〗返回本页;'">
      

  2.   

    用onbeforeunload事件
    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>
      

  3.   

    用alert是实现了一个时间延迟,你自己试着延迟一下用setTimeout('your code here',100);试试看
      

  4.   

    to;肖冲你的回答,可能是接近真理,不妨给段代码能详细最好,我初尝WEB程序.所以:-)