call javascript function from outside an iframe

后端 未结 3 1063
暗喜
暗喜 2021-01-02 10:45

I have one entire html openning inside an iframe that contains a javascript function getData().Now I am not sure how to call getData() from outside that frame.Also is it pos

3条回答
  •  清酒与你
    2021-01-02 11:48

    in these cases you name your iframe and the main body that uses/launches frame and then use parent.objectname, in JS everything is Object and you should be able to call getData()

    a quick googling led me to this -> http://www.esqsoft.com/javascript_examples/iframe_talks_to_parent/

提交回复
热议问题