Hi everyone,
I'm trying to get the selected text in my editor in IE6 using the following code:
But it's not doing the trick!
I was wondering if there was a different way of doing so?
I'm trying to get the selected text in my editor in IE6 using the following code:
FCKeditorAPI.GetInstance("body").EditorDocument.selection.createRange().text
But it's not doing the trick!
I was wondering if there was a different way of doing so?
Re: get selected text in IE6
Re: get selected text in IE6
Hi LesBarstow,
Your code should be the following in order for it to work:
Re: get selected text in IE6
IE6 apparently looses the selection the moment FCKeditor looses the focus. that's why when I was trying to get the selected text it was returning nothing!
My issue now is keeping the selection available to be fetched even if I click somewhere outside the editor... this only happens in IE6 (FF works just fine)..
Re: get selected text in IE6
Attach a listener with OnSelectionChange event after FCKEditor is loaded
This way you get the selected range even when the focus is not in editor window.
Hope it works for you as well (This code was working fine in 2.6, not sure abt V3)
Regards
Kapil