1·首先下载kindeditor包,放在我们的项目目录下
kindeditor包下载
2·目录结构:
3·创建kindeditor实例时:
KindEditor.ready(function(K) {
editor = K.create('#editor',{
width:'150px',
height:'300px',
items:[
'code', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
'anchor', 'link', 'unlink'
],
/* 制定上传方法 */
uploadJson :'${pageContext.request.contextPath}/kindeditor/jsp/upload_json.jsp',
/* 图片管理器的路径 */
fileManagerJson : '${pageContext.request.contextPath}/kindeditor/jsp/file_manager_json.jsp',
allowFileManager : true,
});
}
5·图片上传成功