I am having trouble figuring out how to find the cursor location. I want to use that location to place a hyperlink that I need to create for my users. So they type, click a button to make a hyperlink, choose the item they are linking to( I create the text for the hyperlink), click save, and I paste in behind the scenes that hyperlink and they continue typing after it. I also need that cursor location so I can grab the hyperlink for editing.
Can anyone help me find that cursor location in javascript, Please?
Thank you
To insert an HTML string at
To insert an HTML string at the caret position you can use the editor.insertHtml method and to insert an element editor.insertElement. You can get the caret position by the editor.getSelection method, but it's really complicated to insert something correctly into the DOM, so better to use the insertion methods.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+