简体   繁体   English

内联使用CKeditor时保存内容

[英]Saving content while using CKeditor inline

I'm currently using the inline option within CKeditor (4.4.2) to edit different areas in a HTML file. 我目前在CKeditor(4.4.2)中使用内联选项来编辑HTML文件中的不同区域。 What I want to do is to save the HTML file after someone stops editing a editable area (after the editor closes). 我要做的是在某人停止编辑可编辑区域后(在关闭编辑器之后)保存HTML文件。 But I can't find any information on how to do this in the CKeditor documentation. 但是我在CKeditor文档中找不到有关如何执行此操作的任何信息。

Does someone know anything about how to do this? 有人知道如何做吗? I was excepting some sort of an event to listen to, but I could not find this in the documentation. 除了要监听的某种事件外,我在文档中找不到该事件。

Use editor#blur and editor#change events (depending on your needs). 使用editor#blureditor#change事件(取决于您的需求)。 Do not use focusout because CKEditor is far more complicated than that (see my previous answer to know why). 不要使用focusout因为CKEditor远不止focusout (请参阅我先前的答案以了解原因)。

You may also find a built-in events buffer ( CKEDITOR.tools.eventsBuffer ) useful to reduce the number of AJAX calls. 您可能还会发现一个内置的事件缓冲区( CKEDITOR.tools.eventsBuffer )对于减少AJAX调用的数量很有用。

Some ol' jsFiddle . 一些jsFiddle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM