#7557 closed bug (fixed)
outerWidth()
Reported by: | Owned by: | Timmy Willison | |
---|---|---|---|
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.
Change History (14)
comment:1 follow-up: 2 Changed 13 years ago by
Owner: | set to songofchrist@… |
---|---|
Status: | new → pending |
comment:2 Changed 13 years ago by
Replying to jitter:
Can you elaborate on this? In previous version
$(window).outerWidth()
returnsNaN
for me.
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.
comment:3 Changed 13 years ago by
Owner: | songofchrist@… deleted |
---|---|
Status: | pending → new |
comment:4 Changed 13 years ago by
Component: | unfiled → css |
---|---|
Keywords: | regression added |
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.
comment:5 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | open → closed |
Yay for quick release cycles. This is fixed in currently available release versions of Chrome.
comment:6 Changed 12 years ago by
What about FF and IE (Opera?) original reporter claims it fails there too.
comment:7 Changed 12 years ago by
Milestone: | 1.5 |
---|---|
Resolution: | worksforme |
Status: | closed → reopened |
This is not fixed, even in latest Chrome and latest jQuery.
comment:8 Changed 12 years ago by
Also, as mentioned by the original reporter and jitter, this isn't a Chrome or WebKit specific bug.
comment:9 Changed 12 years ago by
Keywords: | regression removed |
---|---|
Milestone: | → 1.6.2 |
Owner: | set to Timmy Willison |
Status: | reopened → assigned |
comment:10 Changed 12 years ago by
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/
comment:11 Changed 12 years ago by
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.
comment:13 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Return null for outer/inner width/height calls on window/document. Fixes #7557.
Changeset: edb2286544270dc53550180e06668e61c231fb5d
comment:14 Changed 11 years ago by
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