<script language=javascript>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
  window.event.returnValue="确定要退出本页吗?";
  new ActiveXObject("WScript.Shell").sendKeys("{ESC}")}
}
</script>

解决方案 »

  1.   

    我是想一点击X就alert("请点击退出按钮来退出!")
    退出按钮是通过window.close()关闭窗口的。
    (想退出窗口只能通过点击退出按钮)
      

  2.   

    <script language=javascript>
    function window.onbeforeunload()
    {
    if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
      window.event.returnValue="确定要退出本页吗?";}
    }
    </script>
      

  3.   

    你可以打开没有“X”的窗口window.open("","","fullscreen")
    否则,不可能禁止