Skip to main content

Bug Tracker

Side navigation

#12284 closed bug (invalid)

Opened August 13, 2012 07:03PM UTC

Closed August 29, 2012 09:18PM UTC

Last modified November 04, 2012 05:46PM UTC

$(window).height() is wrong

Reported by: anonymous Owned by: anonymous
Priority: low Milestone: None
Component: dimensions Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description

Tested in Chrome.

In version 1.7.2:

$(window).height(): 498

$(document).height(): 2348

In version 1.8.0:

$(window).height(): 2348

$(document).height(): 2348

Attachments (0)
Change History (8)

Changed August 13, 2012 07:04PM UTC by timmywil comment:1

owner: → anonymous
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/. Open the link and click to "Fork" (in the top menu) to get started.

Changed August 13, 2012 10:33PM UTC by mikesherov comment:2

This ticket is fool's gold. I created a bug in 1.7.2 when I ambitiously tried to fix window.height() vs. document.height(), only to revert to the pre 1.7.2 behavior for 1.8

If the OP can kindly provide the a fiddle showing the results in 1.7.2 and 1.8.0 and 1.7.1, I'll investigate.

Changed August 15, 2012 01:25AM UTC by anonymous comment:3

status: pendingnew

This bug is very strange, it only seems to happen on certain pages.

You can replicate it like this:

Go to

http://benalman.com/code/test/jquery-run-code-bookmarklet/?name=Run+jQuery+Code&ver=1.7.1&code=alert%28%5B%24%28window%29.height%28%29%2C+%24%28document%29.height%28%29%5D%29%3B%0D%0A

to create a bookmarklet for 1.7.1.

Then go to http://news.ycombinator.com/ and run the bookmarklet.

Then go to

http://benalman.com/code/test/jquery-run-code-bookmarklet/?name=Run+jQuery+Code&ver=1.8.0&code=alert%28%5B%24%28window%29.height%28%29%2C+%24%28document%29.height%28%29%5D%29%3B%0D%0A

to create a bookmarklet for 1.8.0.

Then go to http://news.ycombinator.com/ and run the bookmarklet.

It gives a different (wrong) result.

Changed August 15, 2012 02:57AM UTC by mikesherov comment:4

component: unfileddimensions
priority: undecidedlow
status: newopen

Changed August 29, 2012 09:08PM UTC by timmywil comment:5

status: openpending

It would be better to have a test case from jsfiddle or jsbin instead of a bookmarklet that we cannot manipulate.

Changed August 29, 2012 09:18PM UTC by dmethvin comment:6

resolution: → invalid
status: pendingclosed

I'm going to close this because news.ycombinator.com is in quirks mode. It's horrible practice but it's their right to do so, and they're not using jQuery.

Changed October 19, 2012 01:43PM UTC by mikesherov comment:7

#12766 is a duplicate of this ticket.

Changed November 04, 2012 05:46PM UTC by mikesherov comment:8

#12845 is a duplicate of this ticket.