KindEditor的使用

引入样式和js

<link rel="stylesheet" href="<%=path %>/kindeditor/themes/default/default.css" />
    <link rel="stylesheet" href="<%=path %>/kindeditor/plugins/code/prettify.css" />
    <script charset="utf-8" src="<%=path %>/kindeditor/kindeditor.js"></script>
    <script charset="utf-8" src="<%=path %>/kindeditor/lang/zh_CN.js"></script>
    <script charset="utf-8" src="<%=path %>/kindeditor/plugins/code/prettify.js"></script>
var editor1;
        //加载KindEditor网页编辑器
        KindEditor.ready(function(K) {
                var url = '<%=path %>/info/uploadImg.do';
                    editor1 = K.create('textarea[name="activity_content"]', {
                    cssPath : '<%=path %>/kindeditor/plugins/code/prettify.css',
                    uploadJson : '<%=path %>/info/uploadImg.do',
                    allowFileManager : false,
                });
//editor1.readonly(true);设置只读用
            });
<textarea id="activity_content" name="activity_content" cols="100" rows="8" style="width:900px;height:800px;visibility:hidden;" readonly="readonly">${activity.activity_content}</textarea>
//添加时同步
editor1.sync();


你可能感兴趣的:(KindEditor的使用)