#7234 closed bug (duplicate)
$(selector).not(':has[attribute]') don't work in IE 6-9
Reported by: | pinal | Owned by: | john |
---|---|---|---|
Priority: | blocker | Milestone: | |
Component: | selector | Version: | 1.4.3 |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | #5637 | Blocking: |
Description
Code like this : $('tr').not(':has([colspan])') fine works in not IE browsers, but don't work in IE
Change History (29)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | unfiled → selector |
---|---|
Milestone: | 1.5 → 1.4.4 |
Priority: | undecided → high |
Status: | new → open |
Version: | 1.4.2 → 1.4.3 |
Still an issue in 1.4.3.
comment:3 Changed 12 years ago by
Priority: | high → blocker |
---|
comment:4 Changed 12 years ago by
Milestone: | 1.4.4 → 1.4.5 |
---|
Retargeting due to severity of regressions in 1.4.3.
comment:5 Changed 12 years ago by
Milestone: | 1.4.5 → 1.4.4 |
---|
Retargeting for 1.4.4 as per John’s request.
comment:6 Changed 12 years ago by
I'm a bit confused as to why this is a bug. I think IE is correct with this ( for once ). Unless you meant td and not tr.
tr's doesn't have the colspan attribute
td's always has a colspan value, even if you don't set it (defaults to 1)
Which might be why you were gettings those results.
I did some alternative code to getting a tr where the child td's don't have a colspan (or in my case, have a colspan > 1) here (tested in FF, Chrome, Safari and IE 6,7,8,9)
comment:7 follow-up: 8 Changed 12 years ago by
I made a misprint in a header:) But:
$('tr').not(':has([colspan])')
Such code means: "Get tr which don't have td with colspan attribute". It's a bug because it works fine in not IE browsers and 'has' can accept a selector in jQuery 1.4.* and '[colspan]' is a CSS 2.1 selector.
comment:8 follow-up: 9 Changed 12 years ago by
Replying to pinal:
I made a misprint in a header:) But:
$('tr').not(':has([colspan])')
Such code means: "Get tr which don't have td with colspan attribute". It's a bug because it works fine in not IE browsers and 'has' can accept a selector in jQuery 1.4.* and '[colspan]' is a CSS 2.1 selector.
Yeah that what I thought, I've tried:
$('tr').not('td:has([colspan])') //doesn't work at all
And
//doesn't work in IE 6, 7 and 8 ( Works In non IE browsers and IE9) $('tr').not('td').has('[colspan]')
Example here:
Maybe because colspan defaults to 1 if it is not set IE says it is anyway.
comment:9 follow-up: 10 Changed 12 years ago by
I want to get such table rows by selector. I think $('tr').not(':has([colspan])') is right in selectoin syntax. May be this bug is duplicate of another one, but such selectoion must work.
comment:10 Changed 12 years ago by
Replying to pinal:
I want to get such table rows by selector. I think $('tr').not(':has([colspan])') is right in selectoin syntax. May be this bug is duplicate of another one, but such selectoion must work.
Yes I agree. Although to me
$('tr').not(':has([colspan])')
should be
$('tr').not('td:has([colspan])')
to be syntactally correct, I may be wrong.
Both the examples I've gave should really work, as they are the same technically, but only one does.
comment:11 Changed 12 years ago by
Owner: | set to john |
---|---|
Status: | open → assigned |
comment:12 Changed 12 years ago by
I just was struck by this problem in a project of mine, and created a small fiddle of it, and afterwards searched the bugtracker and found this. Bad choice =)
Anyway, I created the fiddle so I give it to you:
http://www.jsfiddle.net/wailqill/jW5CZ/
Works in ff, not in ie. No matter what version of jQuery.
comment:14 Changed 12 years ago by
IE appears to be behaving differently in jsFiddle vs. true operation.
Here it thinks all td elements have a colspan, it even picks them up in CSS: http://jsfiddle.net/MrTyzik/DSVeg/4/
However outside jsFiddle things match Chrome for me in IE9 beta: http://csh.rit.edu/~ryanw/chaos/ie9-colspan.html
I haven't tried true IE8 or below yet.
Please note the colspan_not_one test at the end though using $('td[colspan!=1]'). In this case, IE does not match FF or Chrome. That feels like a related but different issue.
comment:15 Changed 12 years ago by
Milestone: | 1.4.5 → 1.6 |
---|
This is getting moved to 1.6 for when the $.attr happens.
comment:16 Changed 12 years ago by
Milestone: | 1.6 → 1.next |
---|
comment:17 Changed 12 years ago by
Blocked by: | 5637 added |
---|
comment:18 Changed 12 years ago by
Keywords: | 1.7-discuss added |
---|
Nominating ticket for 1.7 discussion.
comment:23 Changed 12 years ago by
+1, Probably due to attribute camelCase, timmywil and I can fix this.
comment:26 Changed 12 years ago by
Milestone: | 1.next → 1.7 |
---|
comment:27 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
comment:29 Changed 11 years ago by
Milestone: | 1.7 |
---|
http://jsfiddle.net/fa98L/