<script language=javascript>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey)
{
var myWin = window.open('http://www.csdn.net')
//window.event.returnValue=""; 页面提示
}
  
}
</script>试试:_)

解决方案 »

  1.   

    <head>
    <script language="javascript">
    <!--
    function stoprefresh()
    {
    return "你真的要离开该页面?";
    }
    window.onbeforeunload=stoprefresh;
    -->
    </script>
    <head>
      

  2.   

    //检查是否退出
    function checkClose(){
    if (event.clientX>document.body.clientWidth-20 && event.clientY<0||event.altKey){
    window.event.returnValue='确定要退出此页面吗?';
    }
    }
      

  3.   

    用你们的方法,如果用户选择否,那怎么操作?
    var myWin = window.open('http://www.csdn.net')
    这是重新打开了画面,可用户输入的东西怎么办?!