例如:页面标题栏中有一个叉,如果我点击叉的可以提示:"某某软件你是否要退出"

解决方案 »

  1.   

    http://blog.csdn.net/Truly/archive/2005/06/15/395114.aspx
      

  2.   

    看看这个能不能实现你的要求
    <HTML>
    <HEAD>
    <SCRIPT>
    function closeIt()
      {
        event.returnValue = "Any string value here forces a dialog box to appear before closing the window.";
      }
    </SCRIPT>
    </HEAD>
    <BODY onbeforeunload="closeIt()">
        <a href="http://www.microsoft.com">Click here to navigate to 
            www.microsoft.com</a>
    </BODY>
    </HTML>
      

  3.   

    方法二
    <body onBeforeUnload="event.returnValue=confirm('Are you sure closing the window?');">