473,508 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.body.clientHeight returns 0 in Firefox

Does anyone know why this returns 0 in Firefox (2) and correct value
in IE (7)?

alert(document.body.clientHeight);

Thank you.

Feb 8 '07 #1
2 10712
On Feb 8, 10:14 am, arman_leg...@hotmail.com wrote:
Does anyone know why this returns 0 in Firefox (2) and correct value
in IE (7)?

alert(document.body.clientHeight);
What makes you think IE is correct? Try the following with and
without a doctype. You may wish to discuss the results on
comp.infosystems.www.authoring.stylesheets:

<URL: http://groups.google.com/group/
comp.infosystems.www.authoring.stylesheets/ >

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>clientHeight</title>
<style type="text/css">
body {margin: 0; padding: 0;}
</style>
<body onload="alert(document.body.clientHeight);"></body>
--
Rob

Feb 8 '07 #2
It differs on different browsers, which I think is bad.

Please take a look here: http://www.quirksmode.org/js/doctypes.html

Feb 8 '07 #3

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

Similar topics

12
10125
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...
6
3923
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
50392
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
1083
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
3345
by: wolfing1 | last post by:
I have the following page that is supposed to self-resize to the image's dimensions when opened, but for some reason it works fine with Firefox, but in IE6 it doesn't. I added the alert and it...
5
7466
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
10242
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 !=...
8
4876
by: dhtml | last post by:
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...
0
7385
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
7046
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
7498
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...
0
5629
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,...
1
5053
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
4707
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...
0
3195
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
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
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.