default.htm包括如下内容.我用javascript打开另一个页面,使软件的界面能够最大化.然后把default.htm,我用了window.close()不过总是出现提示"确认是否关闭".
怎样能够不出现这个.多谢了.<Script language="javascript">
var w=screen.availWidth-10;
var h=screen.availHeight-20;
var objwin = window.open('default.aspx',"main","fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=" + w + ",height=" + h + ",top=0,left=0",true);
objwin.focus();
        window.close(); 
</script>
<html>
<head>
<title>e-Solution</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">


</body>

</html>

解决方案 »

  1.   

    使用hta:How a window is closed programmatically determines whether the user is prompted with a confirmation dialog box. -- Invoking the window.close method on a window not opened with script displays a confirmation dialog box. Using script to close the last running instance of Microsoft Internet Explorer also opens the confirmation dialog box. 
    -- Invoking the window.close method on an HTA closes the application without prompting the user because the HTA is trusted and follows a different security model. For more information on the security model of HTAs, please refer to The Power of Trust: HTAs and Security.
      

  2.   

    如下javascript脚本,在关闭之前加入“window.opener = null;”即可!<script language="javascript">
    function closeMyWindow()
    {
       window.opener = null;
       window.close();
    }
    </script>
      

  3.   

    window.opener = null;
    window.close();
      

  4.   

    我以前搞过这个,不过现在记不清楚了。
    大概有以下两种方法:
    (1)
    在</Head>之前加上这一句,<base target="_self">,关闭窗口时这样写:self.close();(2)
    在开关声明一个<OBJECT id='WebBrowser' classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2' height='0' width='0' VIEWASTEXT></OBJECT>关闭时<script language='javascript'>document.all.WebBrowser.ExecWB(45,1);</script>
    WebBrowser即上面的id,可以自定义。方法一在某些情况下还是会弹出确认框,方法二我目前为止还没发现会弹出确认框。
      

  5.   

    window.opener = null;
    window.close();
    ?没试过这种方法,不过行的话这种更简洁啊,呵呵。
      

  6.   

    window.opener = null;window.close();
      

  7.   

    window.opener = null;window.close();
      

  8.   

    window.opener = null;
       window.close();
    记住啦,又学一招。
      

  9.   

    请问不用java而用c#应该怎么关闭一个窗口?
      

  10.   

    发生的事件可以用
    onbeforeunload来拦截,比如你要它点关闭后弹出对话框,确定才关,否则不关,就要栏这个事件。
    如果栏了onunload是无法实现的(因为先关闭再问你)
      

  11.   

    用window.open()打开的页面可以直接用window.close()而不会有提示
      

  12.   

    window.opener = null;window.close();
      

  13.   

    <script language="javascript">
    window.opener = null;
    window.close();
    </script>