javascript—如何在jquery中从父iframe访问函数或变量

stszievb  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(145)

我有两个iframe,一个是父iframe,另一个是子iframe,单击子iframe中的按钮,我需要从父iframe访问函数或变量。
父iframe:

<iframe id="parentiframe" scrolling="true" src="#"></iframe>

父函数:

function iframe1function() { //$('#SUBFORAPPRL span').click();

    $("[id='field_Update Status'] span").click();
    $('.quote-title-span8').text('Approved');
    $('#approval_act_btn').hide();

}

子iframe:

<iframe src="../../quotation/Approvals.aspx" loading="lazy" height="600" width="100%" id="childIframe" title="Approve Iframe"></iframe>

子按钮:

<button type="button" id="act_btn" class="art10" onclick="iframe1function()">button</button>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题