Modify ↓
Ticket #9815 (closed bug: fixed)
$.contains(element, textNode) always throws in IE8
| Reported by: | ykaul@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.6.3 |
| Component: | core | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Calling jQuery.contains with the second parameter being a text node, Internet Explorer 8 throws a "No such interface supported" exception.
The documentation for $.contains explicitely 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/
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Confirmed, in IE a.contains(b) throws the "No such interface supported" error when a is a normal DOM element and b is a text node. I don't believe there is anywhere that core depends on jQuery.contains for text nodes, so I have updated the documentation.