开发者

Call javascript function residing in iframe from external javascript file

I have one html opennin开发者_开发知识库g inside an iframe.One javaScript function is defined there say getSomething().Now in the parent page I have one external javaScript file.Is it possible for me to access getSomething() from the external javaScript file ?


As long as both URLs are from the same domain, you can do it. Try calling something similar to the following from the external script file:

document.getElementByID("ReferringiFrame").getSomething();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜