Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9815 closed bug (fixed)

$.contains(element, textNode) always throws in IE8

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.6.3
Component: core Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


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 (5)

comment:1 Changed 12 years ago by dmethvin

Resolution: fixed
Status: newclosed

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.

comment:2 Changed 12 years ago by dmethvin

Component: unfiledcore
Milestone: None1.next
Priority: undecidedlow

comment:3 Changed 12 years ago by dmethvin

Milestone: 1.next1.6.3

comment:4 Changed 11 years ago by timmywil

#11189 is a duplicate of this ticket.

comment:5 Changed 11 years ago by Rick Waldron

#11885 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.