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();
4.
function RefreshMaterialManage()
{
$(window.parent.document).find("iframe").each(function () {
//匹配條件(js方法QueryMaterial())
if ($(this).attr("src") == "/ContentManage/Weixin_MaterialManage.aspx")
{
$(this)[0].contentWindow.QueryMaterial();
}
});
}