2017-03-29 5 views

답변

1

다음은 무엇을해야하는지에 대한 개요입니다 : 당신은 실제로 작동하도록 the API docs을 사용할 수 있습니다

// get a reference to the Editor instance 
// (depending on your scenario, this may come from a different place) 
var editor = tinymce.activeEditor; 

// get the node your cursor is in - the one you want to insert after 
var endNode = editor.selection.getEnd(); 

// move the selection after the current node 
editor.selection.select(endNode).collapse(false); 

// insert your content 
editor.selection.setContent("abc"); 

. 위에서 쓴 내용은 문서를 엄격하게 기반으로합니다. 지금은 테스트 할 시간이 없으므로 플러그 앤 플레이가 아닐 것입니다.

+1

감사합니다. @Alin Purcaru ... 세 번째 줄에 사소한 변화가 있습니다. 'editor.selection.collapse();'는 나를 위해 일했습니다. –

+0

예, 세 번째 줄은 실제로 두 줄이어야합니다 : 'editor.selection.select (endNode); editor.selection.collapse (false);' – mroncetwice