主题: 在创建编辑器的时候执行一下清空动作,这个该怎么写啊?
作者: wuliao, 发布日期: 2013-03-22 11:37:24, 浏览数: 2412
该怎么改啊? KindEditor.ready(function (K) {
                        editor = K.create('textarea[name="DevRequirements"]',
                            {
                            filterMode: false,//是否开启过滤模式
                            autoHeightMode: true,
                            uploadJson: '../ashx/upload_json.ashx',
                            fileManagerJson: '../ashx/file_manager_json.ashx',
                            items: ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                                     'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                                     'insertunorderedlist', '|', 'emoticons', 'image', 'link']                           
                        });
                        }

                        function getValues() {
                            // 取得HTML内容
                            var html = editor.html();
                            // 同步数据后可以直接取得textarea的value
                            editor.sync();
                            html = document.getElementById('DevRequirements').value; // 原生API
                            alert(html);
                        }
                    });
作者: 小浪子, 发布日期: 2013-03-22 14:01:47
KindEditor.ready(function(K) {
    editor = K.create('textarea[name="DevRequirements"]', {
        filterMode: false,
        //是否开启过滤模式
        autoHeightMode: true,
        uploadJson: '../ashx/upload_json.ashx',
        fileManagerJson: '../ashx/file_manager_json.ashx',
        items: ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'],
        afterCreate: function() {
            this.html(''); //清空编辑器的值
        }
    });
})

function getValues() {
    // 取得HTML内容
    var html = editor.html();
    // 同步数据后可以直接取得textarea的value
    editor.sync();
    html = document.getElementById('DevRequirements').value; // 原生API
    alert(html);
}

 

回复
发表新帖 发表回复