Kindeditor富文本编辑器使用
生活随笔
收集整理的這篇文章主要介紹了
Kindeditor富文本编辑器使用
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1、效果圖
2、本次使用只對文本內(nèi)容進行編輯,不包含圖片視頻表情包等等
2.1 下載kindeditor前端樣式,全部都需要
2.2 jsp頁面引入js樣式
<script type="text/javascript" src="<%=path %>/static/js/kindeditor-4.1.10/kindeditor.js" charset="UTF-8"></script> <script type="text/javascript" src="<%=path %>/static/js/kindeditor-4.1.10/lang/zh_CN.js" charset="UTF-8"></script>2.3 kindeditor初始化
//items中是需要的功能,不需要可以進行修改刪除KindEditor.ready(function(K) {K.create('#content', { //uploadJson : '<%=request.getContextPath() %>/kindeditor/jsp/upload_json.jsp', //fileManagerJson : '<%=request.getContextPath() %>/kindeditor/jsp/file_manager_json.jsp', //allowFileManager : true, items : [ 'source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', '|', 'selectall', '-', 'title', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', '|', 'advtable', 'hr', 'link', 'unlink', '|', 'about' ],afterBlur: function(){this.sync();}}); });
//如果都需要可以使用以下代碼
KindEditor.ready(function(K) {K.create('#content', { uploadJson : '<%=request.getContextPath() %>/kindeditor/jsp/upload_json.jsp', fileManagerJson : '<%=request.getContextPath() %>/kindeditor/jsp/file_manager_json.jsp', allowFileManager : true, afterBlur: function(){this.sync();} //這行代碼是將輸入內(nèi)容賦值于textarea,必須存在}); }); <textarea style="width:100%;height:200px;visibility:hidden;" name="content" id="content" ></textarea>
?
轉(zhuǎn)載于:https://www.cnblogs.com/lsjBlog/p/9442502.html
總結(jié)
以上是生活随笔為你收集整理的Kindeditor富文本编辑器使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 1Python生成高质量Html文件:P
- 下一篇: Flex 布局教程实例