Invoking JavaScript code in an iframe from the parent page

后端 未结 17 2171
栀梦
栀梦 2020-11-21 07:00

Basically, I have an iframe embedded in a page and the iframe has some JavaScript routines I need to invoke from the parent page.

Now the o

17条回答
  •  萌比男神i
    2020-11-21 07:22

    Use following to call function of a frame in parent page

    parent.document.getElementById('frameid').contentWindow.somefunction()
    

提交回复
热议问题