<body onload="openwin()"> 浏览器读页面时弹出窗口; <body onunload="openwin()"> 浏览器离开页面时弹出窗口;

解决方案 »

  1.   

    body有onbeforeunload的事件<body onbeforeunload="return '提示内容abc';">
      

  2.   

    谢谢楼上两位,huo789(四火)可能理解我的意思了,这样关闭没有确认;mindon(麦盾@深圳)的方法我试过,这样给出有确认,但是不能跳转,而且不支持右键单击状态栏然后点关闭
      

  3.   

    <script language="javascript">
    function UnloadCancel()
    {
    window.event.returnValue = "你是否真的要关闭窗口?";
    }
    function UnloadConfirm()
    {
    //alert('点击确定需要执行的操作');
    window.open("http://andrew.7i24.com");
    }
    </script>
    <body onUnload="javascript:UnloadConfirm();" onbeforeunload="javascript:UnloadCancel();">