I am using radeditor in my project. I want the text which is immediate after the cursor position or immediate before the cursor position.
I can set html using editor.pasteHtml("html") but how can I get the text before or after that position?
I am using radeditor in my project. I want the text which is immediate after the cursor position or immediate before the cursor position.
I can set html using editor.pasteHtml("html") but how can I get the text before or after that position?
In short you should create a range in the content area of RadEditor
and obtain the content selection. Try the solution provided in this forum thread: pasteHtml After Node at Cursor Position?.
You can find additional information about the ranges in these articles:
http://www.wrox.com/WileyCDA/Section/JavaScript-DOM-Ranges-Page-2.id-292302.html http://www.quirksmode.org/dom/range_intro.html http://msdn.microsoft.com/en-us/library/ms535872%28VS.85%29.aspx
Once you create a range in the editor, you can use the GetCaretPosition function from this thread: JavaScript get word before cursor