CKEDITOR函数+设置

CKEDITOR functions + settings

本文关键字:设置 函数 CKEDITOR      更新时间:2023-09-26

我以这种方式声明编辑器:

CKEDITOR.replace( 'content',{
    toolbar:'Basic'
});
  1. 编辑器不会更改为basic样式。

  2. 我想使用诸如 editor.resize(x,y) 之类的函数,但我收到错误Uncaught ReferenceError: editor is not defined 如何引用我刚刚创建的文本区域作为编辑器?

  1. 因为您尚未定义config.toolbar_Basic.

  2. 因为editor变量不是全局的。例如,您可以从对象或事件中获取编辑器CKEDITOR.instances实例:

    CKEDITOR.on( 'instanceCreated', function( evt ) {
        console.log( evt.editor );
    } );