var current_editor = "your_editor_name";
if(CKEDITOR.env.ie)
{
CKEDITOR.instances[current_editor].getSelection().unlock(true);
var selected_text = CKEDITOR.instances[current_editor].getSelection().getNative().createRange().text;
}
else
{
var selected_text = CKEDITOR.instances[current_editor].getSelection().getNative();
}
// So no you can use it to replace something for instance, like I want to do in a custon plugin i've made.
CKEDITOR.instances[current_editor].insertHtml('[foo]' + selected_text + '[bar]');
Re: getSelection() is not working in IE?
http://msdn.microsoft.com/en-us/library/ms535869(VS.85
Re: getSelection() is not working in IE?
var current_editor = "your_editor_name"; if(CKEDITOR.env.ie) { CKEDITOR.instances[current_editor].getSelection().unlock(true); var selected_text = CKEDITOR.instances[current_editor].getSelection().getNative().createRange().text; } else { var selected_text = CKEDITOR.instances[current_editor].getSelection().getNative(); } // So no you can use it to replace something for instance, like I want to do in a custon plugin i've made. CKEDITOR.instances[current_editor].insertHtml('[foo]' + selected_text + '[bar]');