if(event.altKey == true && event.keyCode == 115){
  alert("你同时按下了Alt和F4键");
}

解决方案 »

  1.   

    //框架网页也适用的关闭提示
    <script   language="javascript">
    window.onbeforeunload   =   function()     //author:   meizz
    {
        var   n   =   window.event.screenX   -   window.screenLeft;
        var   b   =   n   >   document.documentElement.scrollWidth-20;
        if(b   &&   window.event.clientY   <   0   ||   window.event.altKey)
        {
            var   xmlhttp   =   new   ActiveXObject("Microsoft.XMLHTTP");
            xmlhttp.open("GET",   "sessionEnd.asp",   false);
            xmlhttp.send(null);
        }
    }
    </script>http://topic.csdn.net/t/20050329/16/3891523.html
      

  2.   

    http://topic.csdn.net/t/20050126/16/3755641.html
      

  3.   

    http://topic.csdn.net/t/20050223/17/3801403.htmlhttp://topic.csdn.net/t/20021228/22/1309108.html
    http://topic.csdn.net/t/20030303/11/1484840.html
      

  4.   

    alt + f4 应该是检测不到的,因为按下这个浏览器就关了。
      

  5.   

    真的吗? KimSoft(革命的小酒天天醉) ?至少在IE里我可以屏蔽 Alt+F4 的关闭动作:document.onkeydown = function()
    {
        var k = window.event.keyCode;
        if (window.event.altKey && k == 115)   //屏蔽Alt+F4
        {
            window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
            return false;
        }
    }
    // --></script>
      

  6.   

    不好意思,可以检测得到,刚没有测试-_-! 又见meizz只是我还是认为:窗体关闭时不应执行耗时的操作
      

  7.   

    if(event.altKey == true && event.keyCode == 115){
      alert("你同时按下了Alt和F4键");
    }
    这样是可以检测到的,只不过alert后,窗口再关闭的.