javascript - Page nested iframe height setting problem
世界只因有你2017-05-19 10:26:37
0
3
770
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?
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). )
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.
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). )
/a/11...
See if this article helps