Modify ↓
Ticket #7451 (closed bug: fixed)
$(document) cannot fetch attributes on document object
| Reported by: | rfernandes@… | Owned by: | snover |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.4.4 |
| Component: | attributes | Version: | 1.4.4rc |
| Keywords: | regression | Cc: | john |
| Blocking: | Blocked by: |
Description
I think this is a regression (1.4.2 is ok)
$(document)[0].nodeName; // Returns "#document"
$(document).attr("nodeName"); // (Now) Returns undefined
Tested on chromium 7.0.517.44 and firefox 3.6 - 4b6
Change History
comment:2 Changed 3 years ago by snover
- Status changed from new to assigned
- Cc john added
- Component changed from unfiled to attributes
- Priority changed from undecided to blocker
- Owner set to snover
- Version changed from 1.4.3 to 1.4.4rc
- Milestone changed from 1.5 to 1.4.4
- Keywords regression added
comment:3 Changed 3 years ago by John Resig
- Status changed from assigned to closed
- Resolution set to fixed
Remove conditional that prevents attr from working on non-Element nodes. Fixes #7451.
Changeset: 56b505c60dd73fbe8f3dbe4eb2f42de1e7a68681
comment:4 Changed 3 years ago by Colin Snover
Remove conditional that prevents attr from working on non-Element nodes. Fixes #7451.
Changeset: a64dc0405064d68c7b7cd0f0fc8ea60086cbcd21
comment:5 Changed 2 years ago by john
There were problems with this fix, resolved here: https://github.com/jquery/jquery/pull/92
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Here is a fiddle for this http://jsfiddle.net/boushley/ySMGF/ As mentioned in the bug, it works fine in 1.4.2 but in all newer versions there are issues (1.4.3, 1.4.4R2, and GIT 0).