Bug Tracker

Opened 11 years ago

Closed 11 years ago

#12631 closed bug (notabug)

attr no longer seems to work

Reported by: stephen@… Owned by: stephen@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:


Since upgrading to jQuery v1.8.2, I am noticing problems with my web site and these usually seem to relate to the use of .attr.

For example, $(this).attr('id') or $(IdOfField).attr('class') is not retrieving the id or class.

Is this a bug?

Change History (10)

comment:1 Changed 11 years ago by Rick Waldron

Owner: set to stephen@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to begin.

comment:2 Changed 11 years ago by akumpulainen@…

I encountered this bug as well: $(this).attr('class') returns the jQuery object of $(this), not the attribute string. I can in some cases avoid this by getting the DOM property with .prop() instead of the attribute string, but this is not always desirable.

comment:3 Changed 11 years ago by akumpulainen@…

Apparently this is not jQuery v1.8.2 bug since I am encountering it on 1.7.2 as well. This happens on Chrome 22.0.1229.79 m but not on latest Firefox. Maybe a Chrome bug?

comment:4 Changed 11 years ago by akumpulainen@…

No wait, it happens on Firefox too, my bad... But it happens in 1.7.2 as well. 1.6.4 works fine.

comment:5 Changed 11 years ago by akumpulainen@…

I found a related comment in release notes page.

comment:6 Changed 11 years ago by akumpulainen@…

Fixed link directly to the comment in question... 1.7.2 release notes page.

comment:7 Changed 11 years ago by akumpulainen@…

I believe this ticket is invalid. TinyMCE breaks .attr for jQuery 1.7.2+ before version 3.5.4. So updating TinyMCE fixes this.

comment:8 Changed 11 years ago by mikesherov

Thanks akumpulainen@…! We suspect the same too but we'll wait to see if Stephen can produce a test case before closing this bug.

comment:9 Changed 11 years ago by anonymous

I am using TinyMCE v.3.4.2, and the previous version of jQuery that I was using was 1.7.1. I have had to revert to 1.7.1 because of this problem. I will have a look at upgrading TinyMCE. Was that just a guess that I was using TinyMCE, or is this problem specifically related to the use of TinyMCE? Thanks.

comment:10 Changed 11 years ago by mikesherov

Resolution: notabug
Status: pendingclosed

Related to TinyMCE specifically.

Note: See TracTickets for help on using tickets.