help with document height/width

Giganews Newsgroups
Subject: help with document height/width
Posted by:  Adam Yee (adamjy…@gmail.com)
Date: Wed, 7 Oct 2009

I can't seem to get IE8 to create a working clientHeight or
clientWidth.  I've tried a few combinations with varied results, but
nothing that works all the way like in FF.

I've tried these (probably a couple others also):
doc_width = document.documentElement.clientWidth;
doc_height = document.documentElement.clientHeight;

doc_width = document.body.offsetWidth + document.body.offsetLeft;
doc_height = document.body.offsetHeight + document.body.offsetTop;

var doc_height = (document.height !== undefined) ? document.height :
document.body.offsetHeight;
var doc_width = (document.width !== undefined) ? document.width :
document.body.offsetWidth;

Can anyone help me out with correct object creation for height and
width (for IE)?

Replies