Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 589847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:27:59+00:00 2026-05-13T15:27:59+00:00

Mozilla & IE developers seem to have simultaneously changed the implementation of their height

  • 0

Mozilla & IE developers seem to have simultaneously changed the implementation of their height elements to represent the Opera implementation… which I previously did not have to worry about.

var height = (document.height !== undefined) ? document.height : document.body.offsetHeight;

When performed on a blank document now returns 0 as the height of the document. My implementation requires knowing the true client viewport to dynamically build on. Chrome and Safari are still acting as they used to.

scrollHeight, and clientHeight are acting exactly the same.

To complicate matters document.height and document.body.offsetHeight are now also taking the full height of the document into account instead of only the viewable area as they used to… I tried an old table spacing method and used a 2000px x 1px transparent andthe document height is set to 2000 now…. naturally Chrome and Safari still work as expected and only give the viewable size.

I am very desperate to fix this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:28:00+00:00Added an answer on May 13, 2026 at 3:28 pm

    The viewport height is not a property of the document, but of the window viewing it. You get the viewport height from window.innerHeight.

    The stuff with document is only needed as a fallback for IE, which doesn’t provide the window.inner dimensions. IE (technically incorrectly) makes the document.documentElement represent the viewport, so you can get the height from its clientHeight, unless you’re in Quirks Mode which (more incorrectly) makes document.body represent the viewport instead. (document.height is totally non-standard; avoid it.)

    So in summary, and assuming you need to support Quirks Mode (let’s hope you don’t):

    var height= (
        'innerHeight' in window? window.innerHeight :
        document.compatMode!=='BackCompat'? document.documentElement.clientHeight :
        document.body.clientHeight
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which browsers other than Firefox support Array.forEach()? Mozilla say it's an extension to the
It sounds like Mozilla is having good luck improving JavaScript performance with TraceMonkey .
What does Mozilla Firefox's XPCSafeJSObject wrapper actually do? MDC 's documentation is as follows:
From the Mozilla Developer Network : [1,4,9].map(Math.sqrt) will yield: [1,2,3] Why then does this:
I was looking through Mozilla's JS in JS code and came across the snarf
Looking at the mozilla documentation , looking at the regular expression example (headed "Creating
I use Firebug and the Mozilla JS console heavily, but every now and then
I am currently testing this in Mozilla FireFox 3.0.5 using FireBug 1.3.0 with jQuery
There is a JavaScript parser at least in C and Java (Mozilla), in JavaScript
Does anyone know of crossbrowser equivalent of explicitOriginalTarget event parameter? This parameter is Mozilla

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.