从其父级调用iframe中的javascript函数?

时间:2010-11-05 23:39:53

标签: javascript iframe

如何在iframe中调用iframe中的Javascript函数?

2 个答案:

答案 0 :(得分:1)

thejh,我刚刚询问如何从其父级调用AN iframe中的一个函数 - “iframe中的函数”,而不是“其父级函数”。而你甚至没有阅读完整的问题。请下次再做。

顺便说一句,答案如下:

window.frames[0].doSomething(); // but be sure the iframe is loaded before calling its functions

答案 1 :(得分:0)

这只用了半分钟的谷歌搜索。你甚至没有写完整的句子。请下次再做。

http://www.velocityreviews.com/forums/showpost.php?p=765140&postcount=2

(顺便说一下,这只适用于域名相同的情况)