Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > document.body.clientHeight returns 0 in Firefox

Reply
Thread Tools

document.body.clientHeight returns 0 in Firefox

 
 
arman_legend@hotmail.com
Guest
Posts: n/a
 
      02-08-2007
Does anyone know why this returns 0 in Firefox (2) and correct value
in IE (7)?

alert(document.body.clientHeight);

Thank you.

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      02-08-2007
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

 
Reply With Quote
 
 
 
 
the DtTvB
Guest
Posts: n/a
 
      02-08-2007
It differs on different browsers, which I think is bad.

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted Returns List and Reversed Returns Iterator ++imanshu Python 7 08-23-2008 04:25 AM
Hash#select returns an array but Hash#reject returns a hash... Srijayanth Sridhar Ruby 19 07-02-2008 12:49 PM
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
block returns and hash element returns Trans Ruby 2 11-06-2005 12:15 PM
IsValid always returns true on server-side under FireFox 0.9 Jeremy ASP .Net 2 07-01-2004 02:43 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57