Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1400 How do I measure the height of my document?

You are here: irt.org | FAQ | DHTML | Q1400 [ previous next ]

In Internet Explorer 4+:

<script language="JavaScript"><!--
function height() {
    if (document.all)
        alert('Document height = ' + document.body.offsetHeight);
}
//--></script>

If you must have the height in Netscape Navigator then include the complete page contents in a layer:

<html>
<head>
<script language="JavaScript"><!--
function height() {
    if (document.all)
        alert('Document height = ' + document.body.offsetHeight);
    else if (document.layers)
        alert('Document height = ' + document.body.document.height);
}
//--></script>
</head>

<body onLoad="height()">

<ilayer id="body">
*** Place your page contents in here ***
</ilayer>

</body>
</html>

Feedback on 'Q1400 How do I measure the height of my document?'

©2018 Martin Webb