KindEditor.ready(function (K) { var editor = K.create('#editor_id', { //上传管理 uploadJson: '/js/kindeditor/asp.net/upload_json.ashx', //文件管理 fileManagerJson: '/js/kindeditor/asp.net/file_manager_json.ashx', allowFileManager: true, //设置编辑器创建后执行的回调函数 afterCreate: function () { var self = this; K.ctrl(document, 13, function () { self.sync(); K('form[name=example]')[0].submit(); }); K.ctrl(self.edit.doc, 13, function () { self.sync(); K('form[name=example]')[0].submit(); }); }, //上传文件后执行的回调函数,获取上传图片的路径 afterUpload: function (url) { var a = $("#uppics").val(); if (a.length > 0) { $("#uppics").val(a + "," + url); } else { $("#uppics").val(url); } //alert($("#uppics").val()) }, afterCreate: function () { //要取值设置这里 这个函数就是同步KindEditor的值到textarea文本框 this.sync(); }, afterBlur: function () { //同时设置这里 this.sync(); }, items: [ 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'emoticons', 'multiimage', 'baidumap', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', 'formatblock', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat' ] }); });