1、首先加入编辑器部分
$(function() { $('a', '.showLableType').bind('click', function() { $('#knowtypeId').val($(this).attr('id')); $('#knowtypeTitleId').val($(this).text()); $('#myModal').modal('hide'); }); //textarea标签就会变成KindEditor编译器 editor = KindEditor.create('textarea[id="content"]', { resizeType : 1, afterChange : function() { //生成导航目录 //initLeftMenuFromHtml(this.html()); }, cssPath : '/text/lib/kindeditor/editInner.css', //插入自己upload_json.jsp文件的位置 uploadJson : '/text/lib/jsp/upload_json.jsp', //uploadJson : '/kindeditor/fileUpload', formatUploadUrl : false, allowPreviewEmoticons : false, allowImageUpload : true, id : 'content1', items : [ 'source', 'fullscreen', '|', 'fontsize', 'forecolor', 'bold', 'italic', 'underline','strikethrough', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', 'lineheight', '|', 'formatblock', 'quickformat', 'table', 'hr', 'pagebreak', '|', 'link', 'image', 'code', 'insertfile', 'wcpknow','taobao' ] });
2、导入官网的.js文件
<script charset="utf-8" src="<c:url value="/text/lib/kindeditor/kindeditor-all-min.js"/>"></script> <script charset="utf-8" src="<c:url value="/text/lib/kindeditor/zh_CN.js"/>"></script>
3、运行SSH程序,在编辑栏插入图片显示500错误JSONObject cannot be resolved to a type
我的办法:将kindeditor官网下载的三个jar包导入到Tomcat下的lib文件夹下,错误消除
这三个jar包