2013-11-04 29 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');