Changes to selection and range functionality in IE8
问题 I'm having to debug a WYSIWYG javascript based HTML editor that is failing in IE8. It's only designed for use in IE so that should simplify the solution. Here's the existing code that is failing: function isAllowed() { var sel var obj sel = foo.document.selection if (sel.type != "Control") { obj = sel.createRange().parentElement() } else { obj = sel.createRange()(0) } if (obj.isContentEditable) { foo.focus() return true } else { return false } } Essentially what is happening is that if you