Home >Web Front-end >HTML Tutorial >The page _html/css_WEB-ITnose in the iframe cannot be [accessed] from the parent page

The page _html/css_WEB-ITnose in the iframe cannot be [accessed] from the parent page

WBOY
WBOYOriginal
2016-06-24 12:19:121010browse



The home page... has four buttons and an iframe.

I am currently on the homepage and cannot access the buttons of the iframe...

There are also updates to the iframe. In addition to document.getelementbyid and so on, is there anything else? ......


Reply to the discussion (solution)

Through document.getElementByIdx('ifrm') this is compatible with browsers such as ie and ff, so it is the most Good method. Access the button document.getElementByIdx('ifrm').contentWindow.document.getElementById('btn') in the iframe. Of course you can use some class libraries. jquery is good, the API is very detailed, and there is a powerful search engine that can help you use jquery.

Using document.getElementByIdx('ifrm') is compatible with browsers such as IE and FF, so it is the best method. Access the button document.getElementByIdx('ifrm').contentWindow.document.getElementById('btn') in the iframe. Of course you can use some class libraries. jquery is good, the api is very detailed, and it has a powerful search engine... I have tried your method, but I can't access the content of the child page on the parent page. But thank you, I found the method in the JS forum

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn