Side navigation
#5930 closed bug (duplicate)
Opened January 26, 2010 04:05AM UTC
Closed April 15, 2011 04:12AM UTC
Last modified April 15, 2011 04:12AM UTC
$('[selected]') Has Attribute Selector failing in IE8
Reported by: | miketaylr | Owned by: | john |
---|---|---|---|
Priority: | blocker | Milestone: | 1.6 |
Component: | selector | Version: | 1.4.4 |
Keywords: | ie8 queryselectorall qsa sizzle attribute boolean | Cc: | |
Blocked by: | Blocking: |
Description
Summary: $('[selected]') always fails in IE8 (but not ie6, or ie7)
It appears that IE8 has a bug in its querySelectorAll implementation, so I think Sizzle is just inheriting the problem here.
$('[selected=selected]) works, whereas $('[selected]') never does.
Here's a link to the qunit tests on "boolean" Has Attribute selectors: http://miketaylr.com/test/qunit/has_attribute_selector.html
Also, here's a simple test page on the IE8 QSA broken-ness:
Attachments (0)
Change History (12)
Changed January 26, 2010 04:12AM UTC by comment:1
milestone: | 1.5 → 1.4.2 |
---|---|
version: | 1.4 → 1.4.1 |
Changed February 05, 2010 07:07PM UTC by comment:2
resolution: | → wontfix |
---|---|
status: | new → closed |
I think we're just recommending that people use :selected instead of [selected] in their code. Not only is it easier to use but it's also consistent across platforms.
Changed February 05, 2010 11:00PM UTC by comment:3
resolution: | wontfix |
---|---|
status: | closed → reopened |
Didn't mean to close this, it's still something we want to tackle.
Changed November 19, 2010 01:28AM UTC by comment:5
milestone: | 1.4.2 → 1.5 |
---|
Changed November 21, 2010 04:10AM UTC by comment:7
keywords: | ie8, qsa, Sizzle → ie8 queryselectorall qsa sizzle attribute boolean |
---|---|
priority: | major → blocker |
status: | reopened → open |
version: | 1.4.1 → 1.4.4 |
Changed January 14, 2011 06:48AM UTC by comment:8
Im using a content mgmt solution that spits in an extra title tag. To figure out what content I am including I have <title context="howc"></title>.
When I try var context = $("title[context]]").attr("context"); context is undefined.
Maybe because my <Title tag is in the wrong place (inside body) maybe because context is not a valid attribute of <Title?
I can clean this up and get something working, but I thought I'd add this to the bug. Thanks.
Changed January 14, 2011 06:58AM UTC by comment:9
I think IE stripped the tag out or something.
This doesn't work either:
var context;
$("title").each(function(){
if($(this).attr("context"))
context=$(this).attr("context");
})
alert(context);
undefined ie7
works in firefox
Changed January 17, 2011 04:51PM UTC by comment:10
milestone: | 1.5 → 1.6 |
---|
This is getting moved to 1.6 for when the $.attr happens.
Changed April 15, 2011 04:12AM UTC by comment:11
resolution: | → duplicate |
---|---|
status: | open → closed |
Changed April 15, 2011 04:12AM UTC by comment:12
Duplicate of #7128.