473,473 Members | 4,189 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

document.clientHeight

Other than Safari 2, what other browsers that support
document.clientHeight ?

I would guess some KHTML did.

I have found the feature, when it is present, to reliably provide the
height of the viewport, excluding scrollbars.

Sep 14 '08 #1
8 4870
On Sep 14, 3:27*am, dhtml <dhtmlkitc...@gmail.comwrote:
Other than Safari 2, what other browsers that support
document.clientHeight ?

I would guess some KHTML did.

I have found the feature, when it is present, to reliably provide the
height of the viewport, excluding scrollbars.
(element).clientHeight
document.**body**.clientHeight

All the browsers support that, I think.

site:opera.com "clientHeight"
site:mozilla.org "clientHeight"
site:microsoft.com "clientHeight"
site:apple.com "clientHeight"
site:webkit.org clientHeight

--
Jorge.
Sep 14 '08 #2
Jorge wrote:
On Sep 14, 3:27 am, dhtml <dhtmlkitc...@gmail.comwrote:
>Other than Safari 2, what other browsers that support
document.clientHeight ?

I would guess some KHTML did.

I have found the feature, when it is present, to reliably provide the
height of the viewport, excluding scrollbars.

(element).clientHeight
document.**body**.clientHeight

All the browsers support that, I think.
Most browsers support (element).clientHeight. But document is not an
element. Not all browsers support document.clientHeight.

>
--
Jorge.
Sep 14 '08 #3
On Sep 14, 5:53*pm, dhtml <dhtmlkitc...@gmail.comwrote:
>
Most browsers support (element).clientHeight. But document is not an
element. Not all browsers support document.clientHeight.
javascript:alert(document.clientHeight)

In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
undefined.
--
Jorge.
Sep 14 '08 #4
On Sep 14, 5:53*pm, Jorge wrote:
On Sep 14, 5:53*pm, dhtml wrote:
Most browsers support (element).clientHeight. But document is not an
element. Not all browsers support document.clientHeight.

javascript:alert(document.clientHeight)

In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
undefined.
document.clientHeight is not widely supported (actually browsers that
support it are deprecating its functionality) and it is recommended to
use document.body.clientHeight which is supported in all browsers.

document.clientHeight, in fact, doesn't make any sense as document is
not an element and merely a placeholder for the DOM tree returned from
the underlying markup and is invisible to one's eyes. You don't have
heights for objects that are not even visible.

;) Cheers,
Arun

Sep 15 '08 #5
Arun wrote:
On Sep 14, 5:53 pm, Jorge wrote:
>On Sep 14, 5:53 pm, dhtml wrote:
>>Most browsers support (element).clientHeight. But document is not an
element. Not all browsers support document.clientHeight.
javascript:alert(document.clientHeight)

In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
>>undefined.

document.clientHeight is not widely supported (actually browsers that
support it are deprecating its functionality) and it is recommended to
use document.body.clientHeight which is supported in all browsers.

document.clientHeight, in fact, doesn't make any sense as document is
not an element and merely a placeholder for the DOM tree returned from
the underlying markup and is invisible to one's eyes. You don't have
heights for objects that are not even visible.
Doesn't IE 6, in strict mode, use document.documentElement.clientHeight?

Andrew Poulos
Sep 15 '08 #6
On Sep 15, 2:18 pm, Andrew Poulos wrote:
Arun wrote:
<snip>
>... and it is recommended to use document.body.clientHeight
which is supported in all browsers.
<snip>
Doesn't IE 6, in strict mode, use
document.documentElement.clientHeight?
It would be better to call it "standards", "CSS" or "CSS1Compat" mode
(the first being normal and the last the internal name
(document.compatMode)) and its opposite something like "quirks" or
"BackCompat" mode. Referring to it as "strict" tends to encourage the
misconception that it has some relationship with the distinction
between "strict" and "transitional" in HTML (and when ECMAScript
introduces a "strict" mode (in the next version) there would be
additional confusion).

But yes, when (document.compatMode == 'CSS1Compat') IE 6 client
dimensions are to be found on the documentElement not the body (and
the values read from the body element will be very wrong). But this is
not necessarily true of other browsers that expose a -
document.compatMode - property.
Sep 15 '08 #7
Arun wrote:
On Sep 14, 5:53 pm, Jorge wrote:
>On Sep 14, 5:53 pm, dhtml wrote:
>>Most browsers support (element).clientHeight. But document is not an
element. Not all browsers support document.clientHeight.
javascript:alert(document.clientHeight)

In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
>>undefined.

document.clientHeight is not widely supported (actually browsers that
support it are deprecating its functionality) and it is recommended to
use document.body.clientHeight which is supported in all browsers.
It was removed from Safari. Safari 2.0.4 had it. Not sure which other
browsers have it (probably some KHTML). Seems to be quite rare.

document.clientHeight, in fact, doesn't make any sense as document is
not an element and merely a placeholder for the DOM tree returned from
the underlying markup and is invisible to one's eyes. You don't have
heights for objects that are not even visible.

It could be argued that documentElement.clientHeight returning the
height of the viewport (sans horz scrollbar) makes less sense. It is
ambiguous and doesn't work that way in all browsers.

Should clientHeight return the cleintHeight of the element? That's what
recent past versions of Opera do. What should
documentElement.scrollHeight return? Should it return the scrollHeight
of the html element or the height of the viewport? What about
documentElement.clientTop, or offsetTop?

The viewport is not the documentElement. There's a lot of special
treatment given to the root node for functionality of the viewport. Even
body gets some special treatment, too (overflow, background, event
handlers).

Garrett
;) Cheers,
Arun
Sep 16 '08 #8
dhtml wrote:
Arun wrote:
>On Sep 14, 5:53 pm, Jorge wrote:
>>On Sep 14, 5:53 pm, dhtml wrote:
Most browsers support (element).clientHeight. But document is not an
element. Not all browsers support document.clientHeight.
javascript:alert(document.clientHeight)

In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --

undefined.

document.clientHeight is not widely supported (actually browsers that
support it are deprecating its functionality) and it is recommended to
use document.body.clientHeight which is supported in all browsers.

It was removed from Safari. Safari 2.0.4 had it. Not sure which other
browsers have it (probably some KHTML). Seems to be quite rare.

>document.clientHeight, in fact, doesn't make any sense as document is
not an element and merely a placeholder for the DOM tree returned from
the underlying markup and is invisible to one's eyes. You don't have
heights for objects that are not even visible.


It could be argued that documentElement.clientHeight returning the
height of the viewport (sans horz scrollbar) makes less sense. It is
ambiguous and doesn't work that way in all browsers.

Should clientHeight return the cleintHeight of the element? That's what
recent past versions of Opera do. What should
documentElement.scrollHeight return? Should it return the scrollHeight
of the html element or the height of the viewport?
(I meant "document's scrollable area").......^^^

What about
documentElement.clientTop, or offsetTop?

The viewport is not the documentElement. There's a lot of special
treatment given to the root node for functionality of the viewport. Even
body gets some special treatment, too (overflow, background, event
handlers).

Garrett
>;) Cheers,
Arun
Sep 16 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: gregl | last post by:
Anyone know how to obtain the true size of the html document's body? The control contains the size that the control was set to. The body object appears to contain the same size. That information...
12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
7
by: dd | last post by:
Hello all. First, I'm a newbie to javascript but not to ASP. Secondly I've been searching for the answer for two hours and I decided to finally post this question. I'm trying to take a...
6
by: maya | last post by:
<tabletag is being ignored here.. why is this.. <div id="img1"> <script type="text/javascript" language="JavaScript"> var cw = document.body.clientWidth; var ch =...
3
by: Cylix | last post by:
As I know, the document height is depend on browser and OS usering using, is there any way to get the height for that particular document height? Thank you.
0
by: trullock | last post by:
Hi, Ive got a LinkButton on my page with populates a repeater with data. Ive also got this: <a href="javascript:alert(document.body.clientHeight);">Click Me</a> When i click 'Click Me' on...
2
by: arman_legend | last post by:
Does anyone know why this returns 0 in Firefox (2) and correct value in IE (7)? alert(document.body.clientHeight); Thank you.
5
by: dmk | last post by:
Hi All, function getWindowSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight =...
1
by: vunet | last post by:
The code below returns the viewport of the browser window but it does not work in IE7 because of the document.documentElement.clientHeight: function pageHeight(){ return window.innerHeight !=...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.