Side navigation
#7557 closed bug (fixed)
Opened November 19, 2010 12:57AM UTC
Closed May 26, 2011 12:00AM UTC
Last modified March 08, 2012 10:36PM UTC
outerWidth()
Reported by: | songofchrist@hotmail.com | Owned by: | timmywil |
---|---|---|---|
Priority: | blocker | Milestone: | 1.6.2 |
Component: | css | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Using Google Chrome a simple call to $(window).outerWidth() results in the message "Uncaught TypeError: Cannot read property 'width' of undefined". Same thing in Firefox and IE. Function worked fine in previous releases. Hope you can manage a fix. Keep up the good work.
Attachments (0)
Change History (14)
Changed November 19, 2010 10:15AM UTC by comment:1
owner: | → songofchrist@hotmail.com |
---|---|
status: | new → pending |
Changed November 19, 2010 04:16PM UTC by comment:2
Replying to [comment:1 jitter]:
Can you elaborate on this? In previous version$(window).outerWidth()
returnsNaN
for me. test case
Yeah, that's what I mean. That's what you would expect -- a result that can be tested in a true/false fashion (in my code, the object outerWidth() is called on may be something besides window, something that does have an outer width value; $(window) is the default if nothing else is provided). The problem seems to be something internal. In the newest version, I don't get NaN. I get the internal error mentioned above, and the script stops executing. If we could get it to return NaN, that'd be great. Hope that helps.
Changed November 22, 2010 02:22AM UTC by comment:3
owner: | songofchrist@hotmail.com |
---|---|
status: | pending → new |
Changed November 22, 2010 07:12AM UTC by comment:4
component: | unfiled → css |
---|---|
keywords: | → regression |
priority: | undecided → blocker |
status: | new → open |
So I guess we need to check that style
properties exist in the cssHooks for width/height, though presumably we will end up returning undefined
instead of NaN when all is said and done.
Changed January 01, 2011 03:05AM UTC by comment:5
resolution: | → worksforme |
---|---|
status: | open → closed |
Yay for quick release cycles. This is fixed in currently available release versions of Chrome.
Changed January 08, 2011 05:01AM UTC by comment:6
What about FF and IE (Opera?) original reporter claims it fails there too.
Changed May 13, 2011 12:36PM UTC by comment:7
milestone: | 1.5 |
---|---|
resolution: | worksforme |
status: | closed → reopened |
This is not fixed, even in latest Chrome and latest jQuery.
Changed May 13, 2011 12:37PM UTC by comment:8
Also, as mentioned by the original reporter and jitter, this isn't a Chrome or WebKit specific bug.
Changed May 13, 2011 02:04PM UTC by comment:9
keywords: | regression |
---|---|
milestone: | → 1.6.2 |
owner: | → timmywil |
status: | reopened → assigned |
Changed May 21, 2011 01:39PM UTC by comment:10
Just to beat a dead horse here, here are 2 JsFiddles
"NaN" returned in jQuery 1.3.2 : http://jsfiddle.net/kn3WM/
"Script Error." error in jQuery 1.4.4 : http://jsfiddle.net/jSYRG/
Changed May 21, 2011 02:15PM UTC by comment:11
On the other hand, the documentation for this method specifically says:
"This method is not applicable to window and document objects; for these, use .width() instead." So I don't think it's fair to expect consistent results across versions for this.
Changed May 25, 2011 09:49PM UTC by comment:12
Changed May 26, 2011 12:00AM UTC by comment:13
resolution: | → fixed |
---|---|
status: | assigned → closed |
Return null for outer/inner width/height calls on window/document. Fixes #7557.
Changeset: edb2286544270dc53550180e06668e61c231fb5d
Changed February 08, 2012 09:25PM UTC by comment:14
Seems like $myelement.outerWidth() does not work if your page is in an iframe. Has that being tested before closing the bug? Should I open a separate ticket for that?
Can you elaborate on this? In previous version
$(window).outerWidth()
returnsNaN
for me.test case