Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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
Blocked by: Blocking:

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 (5)

comment:1 Changed 7 years ago by boushley

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).

comment:2 Changed 7 years ago by snover

Cc: john added
Component: unfiledattributes
Keywords: regression added
Milestone: 1.51.4.4
Owner: set to snover
Priority: undecidedblocker
Status: newassigned
Version: 1.4.31.4.4rc

comment:3 Changed 7 years ago by John Resig

Resolution: fixed
Status: assignedclosed

Remove conditional that prevents attr from working on non-Element nodes. Fixes #7451.

Changeset: 56b505c60dd73fbe8f3dbe4eb2f42de1e7a68681

comment:4 Changed 7 years ago by Colin Snover

Remove conditional that prevents attr from working on non-Element nodes. Fixes #7451.

Changeset: a64dc0405064d68c7b7cd0f0fc8ea60086cbcd21

comment:5 Changed 7 years ago by john

There were problems with this fix, resolved here: https://github.com/jquery/jquery/pull/92

Note: See TracTickets for help on using tickets.