我想从父窗口调用Iframe中的函数。作为
var iframe = document.getElementById("myframe");
if (iframe) {
var iframeContent = (iframe.contentWindow || iframe.contentDocument);
iframeContent.targetFunction();
}
但它不起作用。
因为Iframe的内容是动态添加的(所有内容都添加在iframe on demand even js file中);
我遵循了这个
有什么办法可以解决这个问题吗?