Access external HTML page content of object tags

前端 未结 3 917
清歌不尽
清歌不尽 2021-01-14 14:47

I\'ve searched an answer to this question but can\'t get a way how to do it.

I want to access the content of a div that I have included in an object tag.

My

3条回答
  •  我在风中等你
    2021-01-14 14:58

    Got it! Just use

    window.parent.mainPageMethod(document.getElementById("includedDiv").firstChild.nodeValue);
    

    in the included page and you can get div content in a Javascript function from the main page!

    Thanks for trying to help Jay, I should admit that when you talked about window.name property it put me on the right direction :)

提交回复
热议问题