How to call a function in an iframe from the parent page?

前端 未结 5 745
无人共我
无人共我 2020-12-17 00:20

How to call a function in an iframe from the parent page?

5条回答
  •  有刺的猬
    2020-12-17 00:49

    $("iframe").each(function()
    {
        $(this).one("load", function()
        {
            $(this)[0].contentWindow.myFunction();
        });
    });
    

    It is necessary to loaded iframe ;)

提交回复
热议问题