Hi,
I've been trying for some time now to get the height (the 'scrollable'
height) of the current page (Thanks to Martin Honnen for help so far). I
feel as though I am almost there, but am having an unusual problem. (Please
see the code at the end of this page.)
The text "This text isn't being displayed" isn't, as you might have guessed,
being displayed.
I can't seem to display any 'normal' content unless I include it in the
<script>.
Why?
Why, why why?
Hope you can help,
Paul
----------
<html>
<head>
<title>Display Page Height</title>
<SCRIPT TYPE="text/javascript">
<!--
function pageHeight()
{
docHeight = 0;
if (typeof document.height != 'undefined')
{
docHeight = document.height;
}
else if (document.compatMode && document.compatMode != 'BackCompat')
{
docHeight = document.documentElement.scrollHeight;
}
else if (document.body && typeof document.body.scrollHeight != 'undefined')
{
docHeight = document.body.scrollHeight;
}
writeHeight(docHeight);
}
window.onload = pageHeight;
//-->
</SCRIPT>
</head>
<body>
<p>This text isn't being displayed!</p>
<SCRIPT TYPE="text/javascript">
<!--
function writeHeight(height)
{
document.write("Document has a height of " + height);
}
//-->
</SCRIPT>
</body>
</html>