code: http://jsfiddle.net/4hV6c/4/ just make any selection, and you'll get a script error in ie8
I'm trying to do this:
$(end_node.parentNode).has(start_node)
which in modern browsers (chrome, ff, opera, etc) returns [] if start_node is not in end_node.parentNode, and returns the element (I forget which) if it is found.
now, end_node is a text element, and the parentNode is an actual DOM entity. IE will perform .has on just $(end_node).has(start_node)
but that is obviously different behavior.
Is there a work around to get this to work?
- in IE the fiddle will error, other browsers will alert you with a boolean value.
UPDATE: here is a word around that overrides .has() for my specific scenario.. not sure if it works for all the cases of .has, as I don't know them all. http://jsfiddle.net/8F57r/13/