
Originally Posted by
sharathe
Hi,
I am setting the height of the iframe as
Code:
document.getElementById("MainB").height = document.getElementById("MainB").body.scrollHeight + 50.
//mainb is the id for the iframe.
Well the code used for the content document's height by FF in the script from this thread is:
Code:
currentfr.contentDocument.body.offsetHeight+FFextraHeight;
That would translate to (using your code as a jumping off point):
Code:
document.getElementById("MainB").height = document.getElementById("MainB").contentDocument.body.offsetHeight+50;
However, even with a valid DOCTYPE, if there are other validation errors on the external page, or if it isn't on the same domain as the top page, or if it uses absolute positioning or other styles in such a way that confuse the browser as to its actual height, any of these can cause problems.
Bookmarks