jQuery ajaxForm和CKEditor未按应有方式保存
您好,很抱歉这是一个非常大的系统的一部分,我不会把它全部放进去,如果我遗漏了一些东西,请向我索取 我使用的是jQuerysAjaxForm 和编辑 根据关于CKeditor的文档,“与编辑器实例的代码交互”部分底部的jQuery适配器与ajaxForm一起工作 现在,我的所有内容都用AJAX加载到页面中,并启动一个名为addonLoader的函数,将数据传递到该函数中。这是该函数处理CKEditor的部分jQuery ajaxForm和CKEditor未按应有方式保存,jquery,ckeditor,ajaxform,Jquery,Ckeditor,Ajaxform,您好,很抱歉这是一个非常大的系统的一部分,我不会把它全部放进去,如果我遗漏了一些东西,请向我索取 我使用的是jQuerysAjaxForm 和编辑 根据关于CKeditor的文档,“与编辑器实例的代码交互”部分底部的jQuery适配器与ajaxForm一起工作 现在,我的所有内容都用AJAX加载到页面中,并启动一个名为addonLoader的函数,将数据传递到该函数中。这是该函数处理CKEditor的部分 // check there are not any instance's of
// check there are not any instance's of CKEditor running
$(".addonContent form textarea.editor").each(function(index, element) {
$(this).ckeditor(function(){ this.destroy(); });
});
// add the content to the output area
$(".addonContent").html(data);
// setup Ajax form values
AJAXFormOptions = {
success: addonLoader
};
// activate ajaxForm on any forms from the data shown
$(".addonContent form").ajaxForm(AJAXFormOptions);
// enable the content editor
$(".addonContent form textarea.editor").ckeditor({width:"800px"});
当我的表单通过图像链接提交时,将触发此代码
function submitForm(formID){
(function($){
$(".addonContent form textarea.editor").each(function(index, element) {
$(this).ckeditor(function(e){
this.updateElement();
});
});
$(formID).submit(function(){
// prevent the browser redirect
return false;
});
$(formID).submit();
})(jQuery)
}
我已经检查过formID是否正确,但是由于某种原因,它仍然没有使用放置在CKEditor内部的内容更新textarea。如果有人有此问题,并且知道如何解决它?用于调用
updateElement()
的此是一个DOM节点,而不是CKEditor对象
在您提供的适配器链接上,它显示了如何从文档访问编辑器实例,如下所示:
var editor = $('.jquery_ckeditor').ckeditorGet();
尝试将this.updateElement()
更改为:
$(this).ckeditorGet().updateElement()
现在,您应该调用编辑器实例上的更新,用于调用updateElement()
的这个是一个DOM节点,而不是ckeditor对象
在您提供的适配器链接上,它显示了如何从文档访问编辑器实例,如下所示:
var editor = $('.jquery_ckeditor').ckeditorGet();
尝试将this.updateElement()
更改为:
$(this).ckeditorGet().updateElement()
现在,您应该调用编辑器实例上的更新这里有一个额外的逗号:success:addonLoader,
它将中断IEthanks并修复错误,但不会停止错误您在这里有一个额外的逗号:success:addonLoader,
它将中断IEthanks并修复错误,但不会停止错误