iframe中js方法的调用

1:父页面调用iframe页面中的js方法

$("#iframeId")[0].contentWindow.func();

this.frames[iframeId].resetViewHeight();

2:iframe页面调用父页面的js方法

$(window.parent.func());

3:获取父页面iframe的高度

$("#iframeId" />", window.parent.document).height();

4:获取子页面输入值

$("#aa", $("#iframeId")[0].contentWindow.document).val()

 

posted @ 2022-09-13 16:42  kszsa  阅读(2335)  评论(0编辑  收藏  举报