Side navigation
#15091 closed bug (notabug)
Opened May 14, 2014 03:21AM UTC
Closed May 14, 2014 01:22PM UTC
jQuery reports error when selector's attribute is empty
Reported by: | kennykwok | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.11.1 |
Keywords: | selector | Cc: | |
Blocked by: | Blocking: |
Description
jsFiddle: http://jsfiddle.net/L5gHQ/
Both buttons should be working properly under jQuery 1.11.0 or before.
In latest 1.11.1, the "Default" button strictly reports Javascript error (and this potentially break existing web site badly after upgrade)
I'm not sure if we should we consider this as a bug. It is a deal breaking issue, anyway, when considering upgrading jQuery.
Attachments (0)
Change History (2)
Changed May 14, 2014 04:13AM UTC by comment:1
status: | new → open |
---|
Changed May 14, 2014 01:22PM UTC by comment:2
resolution: | → notabug |
---|---|
status: | open → closed |
This is a direct consequence of fixing #14793 (and even a problem case identified therein); observe the Syntax error, unrecognized expression: option[value=]
exception. To do what you want, just quote the attribute values: http://jsfiddle.net/L5gHQ/8/
I can confirm that this no longer works in 1.x, but what you're doing is just wrong.
1. jQuery docs clearly state that attribute selector must have a quoted value:
2. The correct way to set a "default" is to use the
selected
attribute: http://jsfiddle.net/rwaldron/VLVRr/@timmywil or @gibson042 does this issue look familiar?