How to insert text into a tinyMce edtitor at the current position.
It works perfect in Chrome, FF, Safari, but in IE it always starts at the top of the textarea.
I currently do the following:
tinyMCE.execCommand('mceInsertContent',false, 'blabla this is tekst');
I tried with focus, other commands, nothing works :(.
Thanks for the help, but nothing worked. I found my own solution, and I felt like sharing this was needed, because I only found outdated solutions, that did not work :(.
The solution:
In your TinyMCE init add following code:
Where “actualCaretPositionBookmark” is a global variable in javascript that can be accesed by all your javascript code
Then when you want to add text into your TinyMCE editor via javascript, add following code: