kindeditor中插入图片

1·首先下载kindeditor包,放在我们的项目目录下

kindeditor中插入图片_第1张图片

kindeditor包下载

2·目录结构:

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,
           });
}

4·点击图片时:

kindeditor中插入图片_第3张图片

5·图片上传成功



你可能感兴趣的:(java)