<script for=window event=onbeforeunload> 
if (event.clientX>document.body.clientWidth &&event.clientY<0||event.altKey) 
return("请先保存再关闭?") 
</script>

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>test page</title>
    <script for=window event=onbeforeunload> 
    if (document.all.textfield.value=="") 
    return("请先保存再关闭?") 
    </script>
    </head><body>
    <form name="form1" method="post" action="">
      <input type="text" name="textfield">
    </form>
    </body>
    </html>