Skip to main content

Bug Tracker

Side navigation

#7451 closed bug (fixed)

Opened November 09, 2010 05:02PM UTC

Closed November 09, 2010 08:51PM UTC

Last modified December 06, 2010 10:03PM UTC

$(document) cannot fetch attributes on document object

Reported by: rfernandes@alunos.isel.ipl.pt 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

Attachments (0)
Change History (5)

Changed November 09, 2010 05:24PM UTC by boushley comment:1

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

Changed November 09, 2010 08:43PM UTC by snover comment:2

cc: → john
component: unfiledattributes
keywords: → regression
milestone: 1.51.4.4
owner: → snover
priority: undecidedblocker
status: newassigned
version: 1.4.31.4.4rc

Changed November 09, 2010 08:51PM UTC by John Resig comment:3

resolution: → fixed
status: assignedclosed

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

Changeset: 56b505c60dd73fbe8f3dbe4eb2f42de1e7a68681

Changed November 09, 2010 08:52PM UTC by Colin Snover comment:4

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

Changeset: a64dc0405064d68c7b7cd0f0fc8ea60086cbcd21

Changed December 06, 2010 10:03PM UTC by john comment:5

There were problems with this fix, resolved here:

https://github.com/jquery/jquery/pull/92