Invoking JavaScript code in an iframe from the parent page

后端 未结 17 1817
栀梦
栀梦 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:18

    Same things but a bit easier way will be How to refresh parent page from page within iframe. Just call the parent page's function to invoke javascript function to reload the page:

    window.location.reload();
    

    Or do this directly from the page in iframe:

    window.parent.location.reload();
    

    Both works.

提交回复
热议问题