iframe中的js想调用外部frame的js方法,可以吗?怎么实现?
rt 问题点数:100、回复次数:5Top
1 楼sandyuk(w9)回复于 2003-07-03 09:59:29 得分 15
parent.tt()
Top
2 楼webdj(看庭前花开花落,任天上云卷云舒)回复于 2003-07-03 10:45:13 得分 20
好像是这样吧
window.parent.frames[name].setfunction()Top
3 楼kingdomzhf(旭日东升)回复于 2003-07-03 10:45:40 得分 30
yes
other.html
<html>
<iframe src="index.html">
</html>
index.html
<body>
<script>
function outaa()
{
return 'out';
}
</script>
<iframe src='test6.html'></iframe>
</body>
test6.html
<html>
<body >
<script>alert('call:' + window.parent.outaa())</script>
</body>
</html>
Top
4 楼wssgwps(凸(-_-)凸)回复于 2003-07-03 13:01:43 得分 15
top.fun()Top
5 楼fason(咖啡人生)回复于 2003-07-03 13:09:23 得分 20
iframe所在的frame:parent.fun()
其它frame:parent.parent.frames['frame2'].fun()Top




