Side navigation
#9815 closed bug (fixed)
Opened July 13, 2011 11:11AM UTC
Closed July 13, 2011 12:29PM UTC
Last modified June 10, 2012 05:01PM UTC
$.contains(element, textNode) always throws in IE8
| Reported by: | ykaul@opentext.com | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.6.3 | 
| Component: | core | Version: | 1.6.2 | 
| Keywords: | Cc: | ||
| Blocked by: | Blocking: | 
Description
Calling
jQuery.containswith the second parameter being a text node, Internet Explorer 8 throws a "No such interface supported" exception.
The documentation for
$.containsexplicitely states that the second parameter can be any type of node; not just elements. So this should work and report whether the node is contained in element given through first parameter.
A test case can be found here: http://jsfiddle.net/JpYCA/
Attachments (0)
Change History (5)
Changed July 13, 2011 12:29PM UTC by comment:1
| resolution: | → fixed | 
|---|---|
| status: | new → closed | 
Changed July 13, 2011 12:30PM UTC by comment:2
| component: | unfiled → core | 
|---|---|
| milestone: | None → 1.next | 
| priority: | undecided → low | 
Changed August 26, 2011 02:30AM UTC by comment:3
| milestone: | 1.next → 1.6.3 | 
|---|
Confirmed, in IE
a.contains(b)throws the "No such interface supported" error whenais a normal DOM element andbis a text node. I don't believe there is anywhere that core depends onjQuery.containsfor text nodes, so I have updated the documentation.