2013-11-04 30 views
-2

點擊我有CK編輯器並添加差距button.in的CKEditor的文本區我增加了一個image.when我點擊「添加差距」按鈕相同的圖像將再次加入在CK editor.i的文本區域嘗試了很多,但can't.please幫我我怎樣才能插入CKEditor的影像,當我們在按鈕

感謝& regaurd的 辛杜

        <div class="control-group" align="left" style="float: left" onselect="selectText()"> 
             <textarea name="editor1" id="myTextarea"><p>bdfv<img src="img/gap-placeholder.png"/></p> </textarea> 
            </div> 

            <div style="float: left;margin-left: 5px"> 
             <input type="button" value="Add Gap" onclick="insertText();"> 

回答

0

你可以嘗試的CKEditor的insertHTML功能。

var editor = var editor = CKEDITOR.instances.yourEditorInstance; 
var data = '<img src="img/gap-placeholder.png"/>'; 
editor.insertHtml(data, 'unfiltered_html');