用window.showModalDialog()打开子窗口的同时,如何关闭父窗口?

解决方案 »

  1.   

    在打开的同时关掉父窗口咯,应该还在父窗口中用JS咯,
    打开后,关闭父窗口,要么在打开的子窗口中先把父窗口关掉,在子窗口中用JS,parent.window.close();试试
      

  2.   


    我试过了,不行的!这个对用window.open()打开的窗口有效
      

  3.   

    父窗口中: 
    window.showModalDialog(########);
    之后跟着,window.close();可能不行,子窗口中,在页面加载的时候,
    <body>标签中写,
    <script type="text/javascript">
        parent.window.close();
    </script>
    让它也加载,应该可以的吧,这个
      

  4.   


    window.showModalDialog()打开的窗口父窗口不能先关闭的,要关闭的话只能先把子窗口关闭掉。所以我现在的想法是打开子窗口,隐藏父窗口。只是不知道如何实现?
      

  5.   


    <input type=button onclick="javascript: window.open(xxxx.jsp','','width=544,height=330,scrollbars=1');">xxxx.jsp
    <script>
     window.opener.window.close();
    </script>
      

  6.   

    window.showModalDialog()好象不行吧.
    window.opener好象只是window.open()的才有的.
      

  7.   


    是的,不过window.open()会被360,遨游忽略掉为模式对话框设置的属性
      

  8.   

    showModalDialog
    模态对话框如果连被打开者都关闭不就没意义了.
      

  9.   

    showModalDialog
    打开新窗口为什么要把父窗口关闭呢?
    showModalDialog打开新窗口时,父窗口是不可编辑的吧