Invoking JavaScript code in an iframe from the parent page

后端 未结 17 1829
栀梦
栀梦 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条回答
  •  一生所求
    2020-11-21 07:15

    If you want to invoke the JavaScript function on the Parent from the iframe generated by another function ex shadowbox or lightbox.

    You should try to make use of window object and invoke parent function:

    window.parent.targetFunction();
    

提交回复
热议问题