子窗体更新父窗体内容 JS

open方法打开的窗口:
opener.document.getElementById("")
模态或非模态窗口:
dialogArguments.document.getElementById("");
传入的参数应为window

例子:

父窗体:opener.aspx

<span id="father"></span>
    <a href="son.aspx" target="_blank">open</a>

 

子窗体:son.aspx

<script language="javascript" type="text/javascript">
        function change()
        {
            opener.document.getElementById("father").innerHTML="I FROM SON";

        }
    </script>

 <input type="button" value="change" onclick="change()" />

你可能感兴趣的:(js)