< script charset = "utf-8" src = "/Data/Common/kindeditor/lang/zh-" />

thinkphp 整合kindeditor

1.引入kindeditor的两个js文件

 < script charset = "utf-8" src = "/Data/Common/kindeditor/kindeditor.js"></script >
    < script charset = "utf-8" src = "/Data/Common/kindeditor/lang/zh-CN.js"></script >

2.构造表单

    < form   method = "post">
    内容: < textarea id = "editor_id" name = "content" style = "width:700px;height:300px;">
    & lt;strong & gt;HTML内容 & lt; / strong & gt;
    </textarea >
    < input type = "submit"/>
    </form >

3.初始化编辑器

< script >
    KindEditor.ready(
        function(K)
        {
            window.editor = K.create("#editor_id");
        });
    </script >
文章导航