The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript window height and document height…

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #46513

    as I found on web $(window).height() gives unit less pixel value of browser view-port height and, $(document).height() gives unit less pixel value of actual document height

    and if document height is less than window height then $(document).height() will result in window height..

    in my case I have a document which is 36px of height..

    when I check $(window).height(), $(document).height() are giving same result as 36..

    can someone explain what’s wrong with my browser..?


    I worked it out…

    I had following doctype

    when I change it to

    window height as well as document heights are resulting in 895… why so?


    Weird that changing the doctype would change the value. I’m not sure I understand that one!

    Eric Gregoire

    The most I know is that different doctypes can cause differences in how the page is rendered. Invalid doctypes can also cause browsers to enter quirks mode (which I don’t think is the case here because it looks correct to me) which could also cause all sorts of weird behavior.

    I would really love to find out the reason for this; it’s just so bizarre. “This week on Unsolved MyCSSteries!”

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.