Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9752 closed bug (invalid)

Cannot access class names if class property contains a Non-Breaking Space as the first character

Reported by: fewds Owned by:
Priority: low Milestone: 1.next
Component: selector Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


If a class property has a " " in it as the first character jQuery will not pickup any classes for that element. However if you use a normal space bar to create the space it will successfully pickup the classes after the white space. So I would assume if its trimming white spaces from the beginning of the class property it should also trim off non-breaking spaces? For an example please check out this demo I made: http://jsfiddle.net/GhfVY/

Tested against jQuery 1.6.1 and jQuery 1.6.2 on a Mac (10.6.8) with Firefox 5

Change History (2)

comment:1 Changed 12 years ago by fewds

Quickly updated the html just so I don't have to hear that the buttons ids are all the same. Anyhow here is the new example url: http://jsfiddle.net/fewds/GhfVY/2/

comment:2 Changed 12 years ago by dmethvin

Component: unfiledselector
Priority: undecidedlow
Resolution: invalid
Status: newclosed

The browsers seem to agree that is not valid to do that, for example if you try to target it with a CSS selector:


Note that if the non-breaking space is escaped the selection does work, so the browser considers it to be part of the class name and not a separator.

Note: See TracTickets for help on using tickets.