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包
本文介绍如何在项目中集成KindEditor富文本编辑器,并解决常见的500错误问题,包括配置步骤及所需导入的资源文件。
1168

被折叠的 条评论
为什么被折叠?



