<body onbeforeunload="return('确定要退出吗?');">

解决方案 »

  1.   

    <script language=javascript>
    window.onbeforeunload = function()
    {
      if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
      {
        return "别走嘛~!~!~!~!";
      }
    }
    </script>
      

  2.   

    <body onunload="if (confirm('确定要退出吗?')) {//选择了退出!);}else{//选择了不退出!);}">
    </body>
      

  3.   

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

  4.   

    可不可以出现一个confirm框呢?Google的gmail就这样的——一个confirm对话框
      

  5.   

    兄弟,IE6.0很容易作到,但是IE5好象不好做到的!
      

  6.   

    昨天才看到地,希望对你有用:)
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body><script language="JavaScript">
    <!--
    function CloseWin()
    {
    var ua=navigator.userAgent
    var ie=navigator.appName=="Microsoft Internet Explorer"?true:false
    if(ie)
    {
    var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))
    if(IEversion< 5.5)
    {
    var str  = '<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
    str += '<param name="Command" value="Close"></object>';
    document.body.insertAdjacentHTML("beforeEnd", str);
    document.all.noTipClose.Click();
    }
    else
    {
    window.opener =null;
    window.close();
    }
    }
    else
    {
    window.close()
    }
    }
    function queclose()
    {
    if(confirm("你确定关闭吗?"))
    CloseWin();
    }
    //-->
    </script>
    <input type="button" onclick="queclose()" value="关闭">
    </body>
    </html>