请帮帮我 - 我需要对CKeditor进行全面的重新初始化.我不想重新初始化CKeditor的实例,但我想完全重新加载它.有没有办法实现它?我试着做下一个:
delete window.CKEDITOR;
Run Code Online (Sandbox Code Playgroud)
然后:
//clear for old sources
$('script[src*="/includes/contentEditor/ckeditor/"]').each(function() {
$(this).remove();
});
$('link[href*="/includes/contentEditor/ckeditor/"]').each(function() {
$(this).remove();
});
//load CKeditor again
contentEditor.loadjscssfile('/includes/contentEditor/ckeditor/ckeditor.js', 'js');
contentEditor.loadjscssfile('/includes/contentEditor/ckeditor/adapters/jquery.js', 'js');
Run Code Online (Sandbox Code Playgroud)
我的方法加载编辑器,但重新加载后一些插件不起作用.谢谢你的帮助!
我有插件,我也不需要完全重新初始化CKEditor,只是实例,你做得对吗?
要删除我的实例(我的textarea由ID txt_postMsg引用):
$('#btn_cancelPost').click(function(){
CKEDITOR.remove(CKEDITOR.instances.txt_postMsg);
$('#txt_postMsg').remove();
$('#cke_txt_postMsg').remove();
});
Run Code Online (Sandbox Code Playgroud)
然后我重新创建textarea,并在50ms超时后再次使用textarea调用构造函数,插件重新加载正常.我们有一些非常复杂的插件用于flash /图像编辑,所以你的插件可能有问题吗?
| 归档时间: |
|
| 查看次数: |
19515 次 |
| 最近记录: |