不可行,参看
http://www.csdn.net/expert/topic/459/459780.xml?temp=.7357904

解决方案 »

  1.   

    谁说不可行的,我找到了一个办法:
    function KeyDown() {
    if ((event.altKey)&&((event.keyCode==37)||(event.keyCode==39))){
    alert("不准你使用ALT+方向键前进或后退网页!");
    return false;
    }
    if ((window.event.altKey)&&(window.event.keyCode==115)){  //屏蔽 Alt+F4
    var pwin=window.open("");
    pwin.close();
    // alert("不准你使用ALT+F4关闭网页!");
    //不能使用alert加上它就会关掉
    return false;
    }
    }
      

  2.   

    用showModelessDialog也可以,这样就不因为
    1。单开一IE窗口而影响速度

    2。无法置在原窗口的前面“挡箭牌”<script>
    function document.onkeydown() {
    if ((event.altKey)&&((event.keyCode==37)||(event.keyCode==39))){
    alert("不准你使用ALT+方向键前进或后退网页!");
    return false;
    }
    if ((window.event.altKey)&&(window.event.keyCode==115)){  //屏蔽 Alt+F4
    window.showModelessDialog();
    return false;
    }
    }
    </script>
      

  3.   

    不错, qiushuiwuhen(秋水无恨) 的方法,按ALT+F4时有个弹出框的影。
     fokker(独孤龙) 的方法,在快速按多次ALT+F4的时候也会关闭 :)
      

  4.   

    <script>
    function window.onbeforeunload(){
    if(event.altKey)return "Are u sure?";
    }
    </script>
      

  5.   

    我不会,但是我想学习一下禁止backspace这个键应该怎么写?