First of all
I have no interest in resizing the iframe
.
I'm trying to make the Website inside an iframe
to alert its document height.
Simply I have this pages:
www.PARENT.com
<body>
<iframe src="http://www.CHILD.com" />
</body>
www.CHILD.com
- index.html
- contactus.html
<!-- ** FOOTER SCRIPT ** -->
<script>
var body = document.body,
html = document.documentElement;
var height = Math.max( body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight );
alert( height ); //NOW TELLING MY HEIGHT!
</script>
As mentioned above, in www.CHILD.com
, there are a few pages with different heights, like:
- www.CHILD.com/index.html -- 450px
- www.CHILD.com/contactus.html -- 1000px
And I'm using the script above at footer section of both pages.
But then whenever I run the www.PARENT.com
page, I always get:
Alert:
450
What is the problem here?