How can I position the caret in CKEditor3.x? I have 2 positions and I want use insertHTML() on both positions.
Pseudo-code:
editor.setCaret(20); // function does not exists
editor.insertHtml('::');
editor.setCaret(40); // function does not exists
editor.insertHtml('::');
I have tried (to set caret to position: 20):
var ranges = [];
var range = new CKEDITOR.dom.range( this.document );
range.startOffset = 20;
range.endOffset = 20;
ranges.push( range );
editor.getSelection().selectRanges( ranges );
This is not working. Can anybody help me please?