The page iframe is embedded in a third-party page.
How to set the height of this iframe to eliminate the scroll bar?
Because it is cross-domain, the document of the iframe cannot be obtained. Is there any other way?
PHPz2017-05-19 10:28:37
Unless you can add code in a third-party iframe, it won’t work.
If you can add code, it will inform the parent page height through various cross-domain iframe communication methods.
迷茫2017-05-19 10:28:37
1. document.getElementById('ifr').contentDocument;
2. document.getElementById('ifr').contentWindow.document;
3. window.frames[0].document;
Some information on the Internet states that contentWindow is only valid for IE, and contentDocument is only valid for non-IE browsers. However, after my testing, these two methods are valid for current mainstream browsers (ie, firefox, chrome, safari, opera). )