kindeditor 富文本
一、kindeditor官网:kindeditor官网。
二、KindEditor 4.x 文档:KindEditor 4.x 文档。
二、KindEditor下载地址:KindEditor下载地址
三、KindEditor回显内容(文本、表格)
var editor = "";
$(function () {
KindEditor.options.filterMode = false;
KindEditor.ready(function (K) {
editor = K.create('#editor_id', {
items: [],//配置编辑器的工具栏, 其中”/”表示换行,”|”表示分隔符。数据类型: Array 默认值:就是面这个
noDisableItems: ['source', 'fullscreen'],// designMode 为false时,要保留的工具栏图标。数据类型: Array 默认值: [‘source’, ‘fullscreen’]
filterMode: true,//true时根据 htmlTags 过滤HTML代码,false时允许输入任何代码。数据类型: Boolean 默认值: true
designMode: true,//可视化模式或代码模式 数据类型: Boolean 默认值: true
fixToolBar: false,//值为true,并引入fixtoolbar.js插件时固定工具栏位置。数据类型: Boolean 默认值: false
});
});
});
//回显富文本
$(function(){
setTimeout(function(){
html = document.getElementById('qzd_jbxxs').value;
var box=document.getElementById('box')
box.innerHTML=html;
var txt=box.innerText
editor.html(txt);
},1000)
});
效果:
四、KindEditor置灰(禁止输入)
禁用:editor.readonly(true);
启用:editor.readonly(false);