说我有这样的代码:
<html>
<head>
</head>
<body>
<iframe>
<script>
//execute javascript here to append another piece of javascript in parent body tag
</script>
</iframe>
</body>
</html>
现在我想在iFrame中执行一些javascript,在父体标签中添加另一段javascript。
答案 0 :(得分:1)
如果iframe属于主窗口的同一个域,则只需执行
即可top.functionToBeCalled(argument);