在内联模式下使用CKEditor时,何时可以确保编辑器已完全就绪?

在内联模式下使用CKEditor时,何时可以确保编辑器已完全就绪?,ckeditor,Ckeditor,我正在将CKEditor与CKEditor.disableAutoInline=true一起使用 然后我调用inlineAll来内联所有contenteditables 之后,我立即从编辑器中获取数据: CKEDITOR.inlineAll(); var editor = ... //get the editor instance console.log(editor.getData()); 问题是CKEDITOR更改了标记,而我使用getData得到的标记在更改之前 这就是内容标记的外观:

我正在将CKEditor与CKEditor.disableAutoInline=true一起使用

然后我调用inlineAll来内联所有contenteditables

之后,我立即从编辑器中获取数据:

CKEDITOR.inlineAll();
var editor = ... //get the editor instance
console.log(editor.getData());
问题是CKEDITOR更改了标记,而我使用getData得到的标记在更改之前

这就是内容标记的外观:

<p>test<a href="test.com">aaa</a>test test<a href="test.com">bbb</a>test</p>
<p>test asdf</p>
<a href="http://google.com" target="_blank">link</a>
<p>test</p>
<a href="http://google.com">link</a>
<p>test</p>
CKEDITOR修改标记,使标记位于各自的段落中:

<p>test<a href="test.com">aaa</a>test test<a href="test.com">bbb</a>test</p>
<p>test asdf</p>
<p><a href="http://google.com" target="_blank">link</a></p>
<p>test</p>
<p><a href="http://google.com">link</a></p>
<p>test</p>
问题是,我使用getData收到的标记是修改之前的标记

如何确保CKEditor就绪,并且getData中的标记是最新的标记?

有属性和事件。触发事件时,状态更改为“就绪”。在此之前,编辑器可能会返回缓存的可编辑元素的innerHTML,而不是已处理的数据

所以,若你们想确保你们得到了真实的数据,那个么你们需要检查状态,并等待实例准备就绪,若它还并没有准备好