473,796 Members | 2,455 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.client Height

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

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 4893
On Sep 14, 3:27*am, dhtml <dhtmlkitc...@g mail.comwrote:
Other than Safari 2, what other browsers that support
document.client Height ?

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).clien tHeight
document.**body **.clientHeight

All the browsers support that, I think.

site:opera.com "clientHeig ht"
site:mozilla.or g "clientHeig ht"
site:microsoft. com "clientHeig ht"
site:apple.com "clientHeig ht"
site:webkit.org clientHeight

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

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).clien tHeight
document.**body **.clientHeight

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

>
--
Jorge.
Sep 14 '08 #3
On Sep 14, 5:53*pm, dhtml <dhtmlkitc...@g mail.comwrote:
>
Most browsers support (element).clien tHeight. But document is not an
element. Not all browsers support document.client Height.
javascript:aler t(document.clie ntHeight)

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).clien tHeight. But document is not an
element. Not all browsers support document.client Height.

javascript:aler t(document.clie ntHeight)

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

document.client Height, 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).clien tHeight. But document is not an
element. Not all browsers support document.client Height.
javascript:ale rt(document.cli entHeight)

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

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

document.client Height, 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.docume ntElement.clien tHeight?

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.c lientHeight
which is supported in all browsers.
<snip>
Doesn't IE 6, in strict mode, use
document.docume ntElement.clien tHeight?
It would be better to call it "standards" , "CSS" or "CSS1Compat " mode
(the first being normal and the last the internal name
(document.compa tMode)) 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 "transition al" in HTML (and when ECMAScript
introduces a "strict" mode (in the next version) there would be
additional confusion).

But yes, when (document.compa tMode == '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.compat Mode - 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).clien tHeight. But document is not an
element. Not all browsers support document.client Height.
javascript:ale rt(document.cli entHeight)

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

document.client Height is not widely supported (actually browsers that
support it are deprecating its functionality) and it is recommended to
use document.body.c lientHeight 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.client Height, 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).clien tHeight. But document is not an
element. Not all browsers support document.client Height.
javascript:al ert(document.cl ientHeight)

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

undefined.

document.clien tHeight is not widely supported (actually browsers that
support it are deprecating its functionality) and it is recommended to
use document.body.c lientHeight 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.clien tHeight, 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
5709
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 must be stored somewhere in order for the scroll bars to be enabled when the body is larger than the container. Also, I have noticed that if I initialize the control with a large size, the vertical scrollbar is disabled, but is still visible,...
12
10177
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 scrollbar, you get the height of the entire document, screwing up any chance of centering a window in the browser using these values. Is there a way to get the height of the actual browser window and not the entire page height? Thanks.
7
16275
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 javascript and make it work with asp. Any thought, ideas or pointers in the right direction would be greatly appreciated. I am getting the following error: Microsoft JScript runtime error '800a1391'
6
3934
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 = document.body.clientHeight; document.write("<table border=1 cellpadding=0 cellspacing=0 width=100% height=" + ch-80 + ">");
3
50411
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
1097
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 page load, it pops up with some value like "200" which is correct.
2
10747
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
7496
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 = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode'
1
10261
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 != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null; }
0
10455
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10006
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.