Bug Tracker

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#5930 closed bug (duplicate)

$('[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: http://miketaylr.com/test/ie8qsa.html

Change History (12)

comment:1 Changed 7 years ago by john

Milestone: 1.51.4.2
Version: 1.41.4.1

comment:2 Changed 7 years ago by john

Resolution: wontfix
Status: newclosed

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.

comment:3 Changed 7 years ago by john

Resolution: wontfix
Status: closedreopened

Didn't mean to close this, it's still something we want to tackle.

comment:4 Changed 7 years ago by dmethvin

#5066 is a duplicate of this ticket.

comment:5 Changed 7 years ago by jitter

Milestone: 1.4.21.5

comment:6 Changed 7 years ago by snover

#5918 is a duplicate of this ticket.

comment:7 Changed 7 years ago by snover

Keywords: queryselectorall sizzle attribute boolean added; Sizzle removed
Priority: majorblocker
Status: reopenedopen
Version: 1.4.11.4.4

comment:8 Changed 6 years ago by me@…

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.

comment:9 Changed 6 years ago by anonymous

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

comment:10 Changed 6 years ago by john

Milestone: 1.51.6

This is getting moved to 1.6 for when the $.attr happens.

comment:11 Changed 6 years ago by timmywil

Resolution: duplicate
Status: openclosed

comment:12 Changed 6 years ago by timmywil

Duplicate of #7128.

Note: See TracTickets for help on using tickets.