通过jquery将图像附加到ckeditor
我正在使用ckeditor在网站上添加post:
当我通过jquery单击按钮时,我想将一些文本或图像附加到它的textarea。
我尝试了这个,但没有奏效:
$(document).ready(function(){ $('.button').click(function(){ img = "'"; $(".cke_editable").append(img); // also I tried: $("#editor1").append(img); }); });
谢谢。
使用CKEditor API :
用这个 :
var img=$("");
看起来你在那里有一个额外的引用,我想你可能需要把它作为一个jquery对象。 确保使用var
关键字将变量保持为本地。