Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Document height/width

Status
Not open for further replies.

chebbi

Programmer
Feb 6, 2002
98
IN
Hi

Is there a property or any other feature in either javascript/DOM where i can find out the height and width of the document being loaded?

The page is coming up from server side and i want to find out its height and width and use it for some other calculation as soon as the page loads.

I tried document.offsetWidth but that didnt work.

Badrinath Chebbi
 
THIS FUNCTION GIVES AN ERROR IF YOUR DOCUMENT IS EMPTY


<script language=&quot;JavaScript&quot;>
<!--
var height;
var width;
if (document.all)
{
height = document.body.offsetHeight;
width = document.body.offsetWidth;
}
else if (document.layers)
{
height = window.innerHeight;
width = window.innerWidth;
}
//-->
</script> <CFQuote>THE JOURNEY OF A 1000 MILES BEGINS WITH 1 STEP</CFQuote>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top