1)iframe调用父页面的js
window.parent.freshList();
2)iframe调用多层的父页面的js
以自定义查询新增查询条件的页面newCustom.jsp为例:
var frames=window.parent.parent.window.document.getElementById("operateIframe").
contentWindow.document.getElementById("descriptIframe");
frames.contentWindow.customSearch(queryId);
window.parent 为包含该Ifame(newCustom.jsp)的页面mainCustom.jsp
window.parent.parent 为弹出查询条件设定页面(mainCustom.jsp)的父页面mainPage.jsp.
window.parent.parent.window.document.getElementById("operateIframe")为获得mainPage.jsp的iframe的著录功能的主页面frame.jsp
window.parent.parent.window.document.getElementById("operateIframe").contentWindow.document.getElementById("descriptIframe")为frame.jsp页面左侧菜单树旁边的右侧显示查询结果的表格页面archivesPage.jsp。
customSearch(queryId)为这个页面拥有的js,archivesPage.js中的方法。