Some of the pages on my site are dynamically generated and may be quite long.

It occurred to me that if I put something similar to below on the bottom of my page I could check whether the page extended below the bottom of the Client's screen and provide a link to the top if it did.

VB Code:
  1. <P id=BenchMark name=BenchMark></P>
  2. <SCRIPT LANGUAGE=javascript>
  3. <!--
  4. if (window.BenchMark.style.top>screen.availHeight)
  5. {window.document.write("<A href='javascript: void(0)' onclick='return window.scrollTo(0,0)'>Go To Top</A>")}
  6. //-->
  7. </SCRIPT>

Unfortunately however window.BenchMark.style.top just returns a blank string.

Can anyone else think of a way of doing this client side?