如何在 CKEditor 4.8 中添加自定义监听器? editor.on 不是函数
How to add a custom listener in CKEditor 4.8? editor.on is not a function
我正在尝试使用 "editor.on" 遵循 CKEDITOR 的 guide of inserting a custom listener,插入 ckeditor.config.js 但我得到
Uncaught TypeError: editor.on is not a function
我需要它来更改编辑器请求和响应以获取 JSON 以便 uploadimage 插件可以工作。非常感谢任何建议。
我找到了一种在 ckeditor.config.js 中加载它的方法,对我有用,但如果您知道更好的方法或知道任何影响,请纠正我,谢谢。
CKEDITOR.on( 'instanceReady', function( ev ) {
ev.editor.on // followed by the code
} );
我使用的上述指南的示例代码:
CKEDITOR.on( 'instanceReady', function( ev ) {
ev.editor.on( 'fileUploadRequest', function( evt ) {
var xhr = evt.data.fileLoader.xhr;
xhr.setRequestHeader( 'Cache-Control', 'no-cache' );
xhr.setRequestHeader( 'X-CUSTOM', 'HEADER' );
xhr.withCredentials = true;
} );
我正在尝试使用 "editor.on" 遵循 CKEDITOR 的 guide of inserting a custom listener,插入 ckeditor.config.js 但我得到
Uncaught TypeError: editor.on is not a function
我需要它来更改编辑器请求和响应以获取 JSON 以便 uploadimage 插件可以工作。非常感谢任何建议。
我找到了一种在 ckeditor.config.js 中加载它的方法,对我有用,但如果您知道更好的方法或知道任何影响,请纠正我,谢谢。
CKEDITOR.on( 'instanceReady', function( ev ) {
ev.editor.on // followed by the code
} );
我使用的上述指南的示例代码:
CKEDITOR.on( 'instanceReady', function( ev ) {
ev.editor.on( 'fileUploadRequest', function( evt ) {
var xhr = evt.data.fileLoader.xhr;
xhr.setRequestHeader( 'Cache-Control', 'no-cache' );
xhr.setRequestHeader( 'X-CUSTOM', 'HEADER' );
xhr.withCredentials = true;
} );