var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
uploadJson : '图片上传路径',
fileManagerJson : '${ctxKindeditor}/kindeditor/jsp/file_manager_json.jsp',
allowFileManager : true,
filePostName: 'upload_img',
//上传文件后执行的回调函数,获取上传图片的路径
afterUpload: function (url,data,name) {
/*图片上传成功后回调函数(显示)*/
//alert($("#uppics").val())
},
//将文本编辑器的值与对应标签值同步
afterCreate : function(){this.sync();},
afterBlur:function(){this.sync();},
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
禁用:editor.readonly(true);
启用:editor.readonly(false);