westbrookmajor
Programmer
This code works in all browsers, and the javascript part of this is located as you see it. It does NOT go into the <head> section of your document.
<iframe src="foo/index.html" scrolling="auto" id="frame" width="100%" marginheight="0" marginwidth="0" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
<script type="text/javascript">
function resizeIframe() {
var height = document.documentElement.clientHeight;
height -= document.getElementById('frame').offsetTop;
height -= 0;
document.getElementById('frame').style.height = height +"px";
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>
<iframe src="foo/index.html" scrolling="auto" id="frame" width="100%" marginheight="0" marginwidth="0" frameborder="0">
<p>Your browser does not support iframes.</p>
</iframe>
<script type="text/javascript">
function resizeIframe() {
var height = document.documentElement.clientHeight;
height -= document.getElementById('frame').offsetTop;
height -= 0;
document.getElementById('frame').style.height = height +"px";
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>