id summary reporter owner description type status priority milestone component version resolution keywords cc 8227 Problems with insertElement in IE7 Wilfrid Li " The following is my code snippet that works for every other browser (except IE7) The IE7 I had issues with, was a genuine IE7 (from one of my testing rig), not IE8 emulating as IE7 under development mode. The plugin I have written for CKEditor opens up a new window. After the user finished interacting with the plugin browser window and click submit, it'll automatically generate the required html and insert into the editor. {{{ var FCK = window.opener.CKEDITOR; if (FCK != null) { var mySelection = FCK.instances.CKInstance.getSelection(); if (FCK.env.ie) { mySelection.unlock(true); selected_html = mySelection.getNative().createRange().text; } else { selected_html = mySelection.getNative(); } } }}} The problem is that, the above code works for IE8+ and FF, but when under IE7, 'mySelection.getNative().createRange().text' returns """" '''The work around for this issue is:''' The problem was that, under that specific setup, ""mySelection.getNative().createRange().text"" returns empty string. I did an experiment, where I rewrote my plugin to insert the html content into an iframe within a CKEditor dialog. That particular problem went away after I changed the code to look for window.parent.CKEDITOR However, under such setup, another problem was encountered under IE7, where it did not insert the element properly under such environment. This is an example of the code I used to insert the html element: {{{ var element = FCK.dom.element.createFromHtml(html); FCK.instances.CKInstance.insertElement( element ); }}} However, under IE7, all that did was replaced the selected text with empty lines. I did further experimentation, I discovered the following method worked perfectly under IE7 and other browsers. {{{ FCK.instances.CKInstance.insertHtml( html); }}} " Bug closed Normal Core : Selection 3.0 wontfix