我查看了许多线程,但无法找到解决我问题的答案。所以,我定义了一个CKEditor的情况下,像这样:无法捕捉到CKEditor更改事件
var editor = $('#test-editor');
editor.ckeditor(function() {}, {
customConfig: '../../assets/js/custom/ckeditor_config.js',
allowedContent: true
});
但是我不知道我怎么能赶上change
事件。这是我试过的:
var t = editor.ckeditor(function() {
this.on('change', function() {
console.log("test 1");
});
}, {
customConfig: '../../assets/js/custom/ckeditor_config.js',
allowedContent: true
});
editor.on('change', function() {
console.log("test 2");
});
t.on('change', function() {
console.log("test 3");
});
所有这三次尝试都以失败告终。我应该补充一点,我不想循环浏览一个页面上的所有编辑器,我只想解决一个编辑器在#test-editor
处渲染的特定编辑器。我怎样才能做到这一点?
BTW,我看到我的编辑变量包含一个承诺对象。但我从来没有与他们交涉,我不知道我怎么能用这个事实来赶上事件, – Jacobian