CKEditor使用setData()时会自动丢失初始时绑定的时间,在百度时发现有很多方法都不对. 近期在做项目的时候,由于客户需要,将原来的文本格式的textarea标签更改成富文本编辑器--CKEditor,插件使用起来很方便,网上教程很多.API看起来比较麻烦. 为文本框添加绑定事件的两种方式: 1.CKeditor预加载时可以绑定一次: IS代码: var a = CKEDITOR.replace( id);//id是页面元素的ID值:ckeditor_onFocus是自己定义的方法
这段时间使用js+cookies进行自动草稿保存,个人觉的,这些全在客户端处理比较的好,所以没有使用AJAX+数据库的自动草稿保存方法. 结果出现Ckeditor无法绑定onkeyup,onselect,onclick事件的问题,查看了Ckeditor的API,发现如下说明: instanceReady.ckeditor: fired when the editor is created, but before any callback being passed to the ckeditor(