kindeditor 注意

//根目录路径,可以指定绝对路径,比如 /var/www/attached/

//图片空间地址
$root_path = $php_path.'../../../../ckad/';
//根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/

//影响图片显示
$root_url = $php_url.'../../../../ckad/';


初始化配置,注意过滤模式,容易把dl之类的标签过滤掉。关闭。

KindEditor.ready(function(K) { 
    editor = K.create('#jmzx_cont', {
        allowFileManager: true,
        //resizeType: 1,
        newlineTag: 'p',
        items :[
                'source', '|', 'undo', 'redo', '|', 'code', 'cut', 'copy', 'paste',
                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
                'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
                'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
                'anchor', 'link', 'unlink'
        ],
        filterMode : false,
    });
});

向编辑器内写入内容编辑:

KindEditor.ready(function(K) {  
    var editor = K.create('textarea[name="ncont"]');
    html = editor.html();
    // 同步数据后可以直接取得textarea的value
    editor.sync();
    html = document.getElementById('#ncont').value; // 原生API
    //html = K('#ncont').val(); // KindEditor Node API
            
    editor.html('');
            
            
});

<textarea id="ncont" name="ncont" style="width:800px;height:400px;"><?php echo $t['ncont']; ?></textarea>


你可能感兴趣的:(kindeditor)