Skip to main content

Bug Tracker

Side navigation

#7500 closed bug (fixed)

Opened November 13, 2010 01:36PM UTC

Closed December 06, 2010 10:03PM UTC

Last modified May 08, 2011 05:38PM UTC

attr() fails for non DOM element nodes

Reported by: jitter Owned by: jitter
Priority: blocker Milestone: 1.5
Component: attributes Version: 1.4.4
Keywords: regression attr non DOM element Cc:
Blocked by: Blocking:
Description

With the changes for 1.4.3 a regression was introduced which prevented the use of attr() on anything but DOM element nodes (where nodeType is 1) see #7451 and the fix in 1.4.4 commit #a64dc0

But now attr(name) and attr(name, value) fails in various circumstances.

test case switch from version 1.4.2 to 1.4.3 to 1.4.4 to see how the behavior changed from working, to partially working to breaking with exceptions.

Attachments (0)
Change History (20)

Changed November 13, 2010 01:52PM UTC by jitter comment:1

_comment0: [https://github.com/jquery/jquery/pull/92 pull request]1289656419350596

pull request

There is much noise from whitespace changes use diff -w to see the what's really going on

Changed November 13, 2010 02:12PM UTC by addyosmani comment:2

component: unfiledattributes
keywords: → attr non DOM element nodes
priority: undecidedlow
status: newopen

Changed November 13, 2010 08:40PM UTC by dmethvin comment:3

keywords: attr non DOM element nodesregression attr non DOM element

Changed November 14, 2010 04:36PM UTC by rwaldron comment:4

milestone: 1.51.4.5
priority: lowblocker

Addy, I'm gonna change this to a blocker until we get a consensus on the behaviour regression.

Changed November 14, 2010 04:46PM UTC by rwaldron comment:5

#7497 is a duplicate of this ticket.

Changed November 15, 2010 12:44AM UTC by SlexAxton comment:6

#7505 is a duplicate of this ticket.

Changed November 15, 2010 10:34PM UTC by addyosmani comment:7

#7517 is a duplicate of this ticket.

Changed November 20, 2010 06:28PM UTC by rwaldron comment:8

owner: → jitter
status: openpending

Changed November 21, 2010 09:50PM UTC by jitter comment:9

status: pendingopen

Why pending?

Changed November 21, 2010 10:04PM UTC by rwaldron comment:10

@jitter - weird, I don't remember doing that at all... But check this out: I DID post this... 28 hours ago: http://bugs.jquery.com/ticket/7582

Changed November 21, 2010 10:28PM UTC by snover comment:11

status: openassigned

Changed November 21, 2010 10:29PM UTC by snover comment:12

Changed November 22, 2010 11:22AM UTC by jitter comment:13

#7591 is a duplicate of this ticket.

Changed November 23, 2010 02:47AM UTC by rwaldron comment:14

#7605 is a duplicate of this ticket.

Changed November 30, 2010 09:52PM UTC by rwaldron comment:15

#7665 is a duplicate of this ticket.

Changed December 01, 2010 02:39PM UTC by jitter comment:16

#7503 is a duplicate of this ticket.

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

resolution: → fixed
status: assignedclosed

Landed

Changed January 14, 2011 10:20PM UTC by jitter comment:18

milestone: 1.4.51.5

Move fixed tickets to appropriate milestone

Changed May 08, 2011 05:32PM UTC by shepik comment:19

The bug reappeared again

1.5.2: everything ok

1.6.0: Getting attribute foo failed for node of type plainjsobject elem.getAttribute is not a function

http://jsfiddle.net/A9auC/22/

Changed May 08, 2011 05:38PM UTC by timmywil comment:20

As the docs for http://api.jquery.com/attr states, do not use attr on the document or plain objects. http://api.jquery.com/prop will work instead, but for the document I suggest attaching data with http://api.jquery.com/data unless property manipulation is necessary.