Hi,
I have written a small custom plugin. At some time, I need to get the text selected (highlighted) by the user.
In Firefox, it works fine, but IE (6-8) often returns the entire contents of the editor, not just the selected word(s).
Here is the part of the code I use for this:
Does anyone know how to resolve this in IE?
Thank you very much for any hints.
Chris.
I have written a small custom plugin. At some time, I need to get the text selected (highlighted) by the user.
In Firefox, it works fine, but IE (6-8) often returns the entire contents of the editor, not just the selected word(s).
Here is the part of the code I use for this:
var selectedWords = ''; if (CKEDITOR.env.ie) { var ranges = selection.getRanges(); if (ranges.length == 1 && !ranges[0].collapsed) selectedWords = selection.getStartElement().getText(); } else selectedWords = selection.getNative();
Does anyone know how to resolve this in IE?
Thank you very much for any hints.
Chris.