javascript - 如何在CKEDITOR中动态更改插件设置?

标签 javascript ckeditor word-count

创建 CKEDITOR 实例时如何动态更改插件的设置?

我在自定义config.js中编写:

config.wordcount = {
    // Whether or not you want to show the Word Count
    showWordCount: false,
    // Whether or not you want to show the Char Count
    showCharCount: true
};

我想要做的是将 maxCharCount 设置为某个值,具体取决于 CKEDITOR 实例。

有没有简单的方法可以实现这一点?

最佳答案

找到解决方案:

CKEDITOR.replace('field', {
    wordcount: {'showWordCount': false,
                'showParagraphs': false,
                'showCharCount': true,
                'maxCharCount': 100
            }
});

关于javascript - 如何在CKEDITOR中动态更改插件设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34606896/

相关文章:

javascript - 在另一个数组中使用 array.push 会产生 undefined

javascript - 将事件从 HTML 元素冒泡到 iframe

javascript - 如何为不同高度的多个实例设置CKEditor?

Django Ckeditor 从 richtextfield 中保存不完整的数据到 cookie 或服务器

hadoop - MapReduce Job如何在HDFS上工作?

javascript - 如何成功地为 div 运行 onclick?

javascript - 在 JavaScript 中使用异步 AJAX 请求管理异步 IndexedDB

javascript - CKEDITOR - 关闭 html 编码

在 C 中读取标志和文件名的命令行参数

字数统计旁边的 Hadoop 示例