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().textBut it's not doing the trick!
I was wondering if there was a different way of doing so?

Re: get selected text in IE6
var range = FCKeditorAPI.GetInstance("body").Selection();Re: get selected text in IE6
var range = FCKeditorAPI.GetInstance("body").Selection.getSelection()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
oFCKeditor.Events.AttachEvent( 'OnSelectionChange', setEditorSelection); function setEditorSelection(oFCKeditor){ if (document.all){ oRange = oFCKeditor.EditorDocument.selection.createRange(); } }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