#7500 closed bug (fixed)
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.
Change History (20)
comment:2 Changed 13 years ago by
Component: | unfiled → attributes |
---|---|
Keywords: | attr non DOM element nodes added |
Priority: | undecided → low |
Status: | new → open |
comment:3 Changed 13 years ago by
Keywords: | regression added; nodes removed |
---|
comment:4 Changed 13 years ago by
Milestone: | 1.5 → 1.4.5 |
---|---|
Priority: | low → blocker |
Addy, I'm gonna change this to a blocker until we get a consensus on the behaviour regression.
comment:8 Changed 13 years ago by
Owner: | set to jitter |
---|---|
Status: | open → pending |
comment:10 Changed 13 years ago by
@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
comment:11 Changed 13 years ago by
Status: | open → assigned |
---|
comment:18 Changed 12 years ago by
Milestone: | 1.4.5 → 1.5 |
---|
Move fixed tickets to appropriate milestone
comment:19 Changed 12 years ago by
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
comment:20 Changed 12 years ago by
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.
pull request
There is much noise from whitespace changes use diff -w to see the what's really going on