A strange requirement, the center of an html page A needs to use an iframe to open another page B. The content of page B can be long or short, and it is required that the iframe used to display the content of page B adjusts its height according to the actual display height of page B. At the same time, the code of page A cannot be modified.
Solution: Using iframe, you can directly use parent.parent.document to control the content of the parent page's document, but you need to pay attention to the timing of adaptive adjustment, which needs to be done after page B is fully loaded. Implementation code, tested effective in IE: A page (parent.html), code unchanged
B page (child.htm)
111
222
333
444
555
666
777
888
999
000