parent.window你要怎么控制?

解决方案 »

  1.   

    这样的,父窗口一个按钮点击后出现一个模式对话框,模式对话框上选择一个LIST,然后点完成。关闭模式对话框,父窗口的LIST上出现刚才在模式对话框上内容。
    用普通window.open可以,但是换成showModalDialog后就不行了。
    现有代码用的是window.opener,parent.window好像也不行。
    有没有其他办法了呢?
      

  2.   

    showModalDialog('ttt.htm', window)在 showModalDialog 对话框里:if (window.dialogArguments != null)
        var w = window.dialogArguments;w.location.reload();  //父页面刷新
    w.document.all.objID.innerText = "meizz";  //直接给父网页里的元素赋值
      

  3.   

    这位大佬,我试用你上面的代码,出错了。
    location为空或不是对象
      

  4.   

    同样的代码我这里测试通过:
    showModalDialog('ttt.htm', window)ttt.htm:
    <script language="JavaScript">
    <!--
    var w;
    if (window.dialogArguments != null)
        w = window.dialogArguments;
    //-->
    </script>
    <input type=button value=ok onclick="w.location.href='other.htm'">
      

  5.   

    找到原因了,我的调用方法是这样,和你的不同。
    window.showModalDialog('temp.aspx','','dialogHeight: 400px; dialogWidth: 600px; center: Yes; help: No; resizable: No; status: No;');多谢
      

  6.   

    被showModalDialog打开的窗口将中断父窗口的执行直到showModalDialog窗口被关闭
      

  7.   

    或者用showModalDialog的returnValue