How to access parent Iframe from JavaScript

后端 未结 9 1390
梦毁少年i
梦毁少年i 2020-11-22 07:50

Well, I have an IFrame, which calls a same domain page. My problem is that I want to access some information from this parent Iframe from this called page (from JavaScript).

9条回答
  •  粉色の甜心
    2020-11-22 08:49

    you can use parent to access the parent page. So to access a function it would be:

    var obj = parent.getElementById('foo');
    

提交回复
热议问题