zoukankan      html  css  js  c++  java
  • kindeditor使用

    下载地址http://kindeditor.net/down.php

    @官方文档

    使用步骤:

    引入js

    <script charset="utf-8" src="resource/kindeditor-4.1.7/kindeditor.js"></script>
    <script charset="utf-8" src="resource/kindeditor-4.1.7/lang/zh_CN.js"></script>
    View Code

    编辑器初始化:

    KindEditor.ready(function(K) {
            var editor1 = K.create('#editor_id',{
                                        uploadJson : '<%=basePath%>resource/kindeditor-4.1.7/jsp/upload_json.jsp',
                                        fileManagerJson : '<%=basePath%>resource/kindeditor-4.1.7/jsp/file_manager_json.jsp',
                                        allowFileManager : true,
                                        imageSizeLimit : '2MB', //批量上传图片单张最大容量
                                        imageUploadLimit : 5, //批量上传图片同时上传最多个数
                                        afterCreate : function() {
                                            var self = this;
                                            K.ctrl(document, 13, function() {
                                                self.sync();
                                                document.forms['example'].submit();
                                            });
                                            K.ctrl(self.edit.doc, 13, function() {
                                                self.sync();
                                                document.forms['example'].submit();
                                            });
                                        }
                                    });
                });
    View Code

    html代码:

    <textarea id="editor_id" name="newsContent"  ></textarea>
    View Code

    上传图片注意:

    1,保存功能无需自己编写后台代码,配置好uploadJson 、 fileManagerJson 即可

    2,若多图上传失败,请检查uploadJson 、 fileManagerJson的路径

  • 相关阅读:
    #Leetcode# 90. Subsets II
    Linux——网段的划分,子网掩码,ABC类地址的表示法
    Linux——文件目录管理(结构)
    Caffe入门与应用 by GX
    1、概述
    6、多态性-4、抽象类
    6、多态性-3、虚函数
    第二课2、ROS
    第一课1、ROS
    6、多态性-2、运算符重载
  • 原文地址:https://www.cnblogs.com/yanan7890/p/6903550.html
Copyright © 2011-2022 走看看