Side navigation
#1612 closed bug (fixed)
Opened September 13, 2007 04:59PM UTC
Closed December 07, 2009 01:55AM UTC
:contains selector doesn't work for Ajax responses in IE6
Reported by: | julienw | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | selector | Version: | 1.4a1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi,
I wanted to use the selector :contains for Ajax responses, and, while it works perfectly in Firefox, in doesn't work in IE.
My guess is that Ajax responses don't have innerText set in IE (whereas in Firefox, they have textContent; I checked that).
The fix below works for me, for my specific case, but it is maybe too much intrusive, or not enough :
I'm changing this line :
contains: "(a.textContent||a.innerText||'').indexOf(m[3])>=0",
to :
contains: "(a.textContent||a.innerText||a.firstChild.nodeValue||'').indexOf(m[3])>=0",
I could setup a small testcase if you need it.
Attachments (0)
Change History (5)
Changed September 15, 2007 03:05AM UTC by comment:1
resolution: | → fixed |
---|---|
status: | new → closed |
Changed March 31, 2009 06:34PM UTC by comment:2
resolution: | fixed |
---|---|
status: | closed → reopened |
Bug is back in 1.3.2. It seems since the refactoring to filters someone throw out that fix again.
So, line jquery-1.3.2.js#1944 right now is
return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
but should be
return (elem.textContent || elem.innerText || $(elem).text() || "").indexOf(match[3]) >= 0;
(Tested with IE7.0 Win)
Changed March 31, 2009 06:39PM UTC by comment:3
Um, next try:
return (elem.textContent || elem.innerText || $(elem).text() || "").indexOf(match[3]) >= 0;
(Well, preview showed it correctly, but pipes are wiki-tables. So, if it still got removed: between the elem-expressions there should be JavaScript-ORs)
Changed November 30, 2009 06:26PM UTC by comment:4
component: | core → selector |
---|---|
milestone: | 1.2.1 → 1.4 |
version: | 1.2 → 1.3.2 |
Changed December 07, 2009 01:55AM UTC by comment:5
resolution: | → fixed |
---|---|
status: | reopened → closed |
version: | 1.3.2 → 1.4a1 |
Fixed in SVN rev [3300].