不准点击X来关闭当前网页
<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.   

    评论: javascript虽然强大,但不是用来做这种事情的。
    在我的浏览器里根本不起作用。何况用户还可以从文件和标题栏菜单选择关闭,总不能把这也禁止掉把。
      

  2.   

    无边框窗口CW但也可以用alt+F4或结束任务关闭
      

  3.   

    打开一个fullscreen窗口屏蔽alt+F4
    再写一个onunload = newOpenWinfunction newOpenWin()
    {
       alert("你关一个,我再开一个!")
       window.open(document.location.href,"","fullscreen=1")
    }
      

  4.   

    同意onestab(┼─) 仁兄。    不是什么都用做的。而且做了也不一定好。。