【发布时间】:2011-01-06 22:10:56
【问题描述】:
我有一个使用 javascript 的页面并打开一个子窗口,该窗口会更新父窗口中的某些字段。
现在更新的字段有一个onchange()函数我希望子窗口在更新字段时调用这个函数。
这可以使用 javascript 吗?
编辑:
我的代码:
这是打开子窗口的链接:
<a href="javascript:void(0);" style="width:100%; height:125%" onclick="window.open('otherExpenses.php','Ratting','width=350,height=550,left=50,top=50,toolbar=1,status=1,');">Open Child</a>
而在子窗口中,一些操作是通过用户交互完成的,那么子窗口就是这样关闭的:
<a href="javascript:void(0);" onclick="post_value()">Close Child</a>
还有post_value() 函数:
function post_value()
{
opener.document.overHeads.overheadOther.value = document.otherExpenses.TextBox27.value;
opener.document.overHeads.hiddenOther.value = document.otherExpenses.TextBox27.value;
//here I want to call a function from the parent window that updates some field in the parent window.
self.close();
}
【问题讨论】: