导入脚本引用:


<!-- 项目内部js通过requireCss()函数导入-->
<script type="text/javascript">
/**加载kinder编辑器**/
require('js/plugin/kindeditor/kindeditor.js');
require('js/plugin/kindeditor/lang/zh_CN.js');

//文本框

$(function () {
KindEditor.ready(function (K) {
window.editor = K.create('#content', {
//下面这行代码就是关键的所在,当失去焦点时执行 this.sync();,不加就获取不了文本框的值
afterBlur: function () {
this.sync();
}
}
);
});
});




//上传文件


KindEditor.ready(function(K) {
var editor = K.editor({
allowFileManager : true,
uploadJson:'uploadCoverType.do',
formatUploadUrl:false
});
//资料上传
K('#attestationImgId').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
showRemote : false,
imageUrl :K('#attestationImg').val(),
clickFn : function(url, title, width, height, border, align) {
K('#coverType').val(url);
$("#div").css("display","block");
$("#coverType").attr("src",url);
editor.hideDialog();
}
});
});
});
});



</script>