Bug Tracker

Opened 12 years ago

Closed 12 years ago

#8797 closed bug (invalid)

jQuery innerWidth() throws ownerDocument is null

Reported by: Justin Nel Owned by: Rick Waldron
Priority: high Milestone: 1.next
Component: dimensions Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:


jQuery 1.5.1 AND 1.5.2 (jsFiddle only offers 1.5.1 at the moment) Firefox 4.0 Windows 7 Ultimate x64

I would have expected a value from $(document).innerWidth(), but instead it throws an exception.

Exception thrown: TypeError: elem.ownerDocument is null

Example code: http://jsfiddle.net/PwRgy/

If you need more information, please ask.

Change History (4)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfileddimensions
Priority: undecidedhigh
Status: newopen

comment:2 Changed 12 years ago by Rick Waldron

Owner: set to Rick Waldron
Status: openassigned

comment:3 Changed 12 years ago by jboesch

Wondering if this is invalid. If you read http://api.jquery.com/innerWidth/ it says: "This method is not applicable to window and document objects; for these, use .width() instead."

comment:4 Changed 12 years ago by timmywil

Resolution: invalid
Status: assignedclosed

So it does. Now that I think about it, getting innerWidth from document doesn't make sense because the document itself can't have padding.

Note: See TracTickets for help on using tickets.