Bug Tracker

Modify

Ticket #8797 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

jQuery innerWidth() throws ownerDocument is null

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

Description

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

comment:1 Changed 2 years ago by rwaldron

  • Priority changed from undecided to high
  • Status changed from new to open
  • Component changed from unfiled to dimensions

comment:2 Changed 2 years ago by rwaldron

  • Owner set to rwaldron
  • Status changed from open to assigned

comment:3 Changed 2 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 2 years ago by timmywil

  • Status changed from assigned to closed
  • Resolution set to invalid

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.