The forum operates in read-only mode. Please head to StackOverflow for support.
var oEditor = FCKeditorAPI.GetInstance("FCKeditor1"); var select; if(window.getSelection){ //gecko browsers select=oEditor.EditorWindow.getSelection(); }else{ //IE select=oEditor.EditorWindow.selection.createRange(); }
mehmoodz wrote: var oEditor = FCKeditorAPI.GetInstance("FCKeditor1"); var select; if(window.getSelection){ //gecko browsers select=oEditor.EditorWindow.getSelection(); }else{ //IE select=oEditor.EditorWindow.selection.createRange(); }
var Editor = FCKeditorAPI.GetInstance('content'); var select; if(window.getSelection){ //firefox select=Editor.EditorWindow.getSelection(); }else{ //IE select=Editor.EditorDocument.selection.createRange().text; } alert(select);
Or with CKEditor:
var selection = CKEDITOR.instances.editorName.getSelection();
You can also check out the documentation.
var selection = CKEDITOR.instances.editorName.getSelection().getNative();
if (CKEDITOR.env.ie) selection = editor.getSelection().getNative().createRange().text; else selection = editor.getSelection().getNative();
Re: How get text contain selected on editor?
Re: How get text contain selected on editor?
Re: How get text contain selected on editor?
Re: How get text contain selected on editor?
Or with CKEditor:
You can also check out the documentation.
Re: How get text contain selected on editor?
(for CKEditor) :
the result in IE8 is : [latex][object Selection][/latex] -->here for latex balise
on firefox i have : [latex]The text selected[/latex]
Somebody can help me ?
Re: How get text contain selected on editor?