下载页面: http://www.kindsoft.net/down.php

Note

您可以根据需求删除以下目录后上传到服务器。

asp – ASP程序

asp.net – ASP.NET程序

php – PHP程序

jsp – JSP程序

examples – 演示文件

HTML内容

Note

id在当前页面必须是唯一的值。

在该HTML页面添加以下脚本。

KindEditor.ready(function(K) {

window.editor = K.create(‘#editor_id’);

});

Note

var options = {

cssPath : ‘/css/index.css’,

filterMode : true

};

var editor = K.create(‘textarea[name=”content”]’, options);

4. 获取HTML数据// 取得HTML内容

html = editor.html();

// 同步数据后可以直接取得textarea的value

editor.sync();

html = document.getElementById(‘editor_id’).value; // 原生API

html = K(‘#editor_id’).val(); // KindEditor Node API

html = $(‘#editor_id’).val(); // jQuery

// 设置HTML内容

editor.html(‘HTML内容’);

Note

KindEditor的可视化操作在新创建的iframe上执行,代码模式下的textarea框也是新创建的,所以最后提交前需要执行

sync() 将HTML数据设置到原来的textarea。

KindEditor在默认情况下自动寻找textarea所属的form元素,找到form后onsubmit事件里添加sync函数,所以用form方式提交数据,不需要手动执行sync()函数。

KindEditor默认采用白名单过滤方式,可用

htmlTags 参数定义要保留的标签和属性。当然也可以用

filterMode 参数关闭过滤模式,保留所有标签。

// 关闭过滤模式,保留所有标签

KindEditor.options.filterMode = false;

KindEditor.ready(function(K)) {

K.create(‘#editor_id’);

}

https://www.002pc.comhttps://www.002pc.com/phpbiancheng/1966.html

No alive nodes found in your cluster

0踩

0 赞

相关资源:诗词鉴赏大全软件-教育文档类资源-CSDN文库

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年2月7日
下一篇 2021年2月7日

相关推荐