2012-12-06 79 views
0

我的问题是,我想从框架内容更新div内容(与id="content") 从表单提交加载后。Javascript更新来自框架的父级内容

其中表格属性action="test.php"target="source"这是框架名称。

的示例代码是在这里:JSBin

结果从test.php是这样的:

<script type="text/javascript"> 
window.parent.top.getElementById('content').innerHtml = "Western"; 
</script> 

回答

0

您需要的文件参考:

window.parent.document.getElementById('content').innerHtml = "Western"; 
+0

它不工作的方式也。 – mentorgashi