我使用的CKEditor在一個站點添加職位,CKEDITOR:附加的圖像通過jQuery
<textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10"></textarea>
,我想追加一些文字或圖像到它的textarea的,當我點擊通過一個按鈕jQuery的。
我試過,但沒有奏效:
<script>
$(document).ready(function(){
$('.button').click(function(){
img = "<img src='http://localhost/sdn/files/uploads/1368647314.png'/>'";
$(".cke_editable").append(img); // also I tried: $("#editor1").append(img);
});
});
</script>
謝謝。
這個工作就像一個魅力。非常感謝你 –