jQuery iframe之间相互调用

1,子iframe内调用父类函数方法:

window.parent.func();

 

2,子Iframe中获取父界面的元素:

$("#xx", window.parent.document);

这个xx就是父界面中要获取的元素的ID。

 

3,jquery 调用子iframe页面中js的方法:

 iframefunction()是子页面的方法

  $(window.parent.document).contents().find("#iframename")[0].contentWindow.iframefunction(); 
原文地址:https://www.cnblogs.com/genghuilove/p/6169167.html