你好我很抱歉这是一个非常大的系统的一部分,如果我遗漏了一些东西,我不会把它全部放出来,请向我索取,
我正在使用 jQuerys ajaxForm http://jquery.malsup.com/form/ 和 CKEditor http://ckeditor.com
根据 CKeditor 上的文档,jQuery 适配器在“与编辑器实例的代码交互”部分底部使用 ajaxForm http://ckeditor.com/blog/CKEditor_for_jQuery ,
现在我的所有内容都使用 AJAX 加载到页面中,并使用传递给它的数据触发了一个名为 addonLoader 的函数,这是该函数中处理 CKEditor 的部分
// 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 有没有人有这个问题并且知道如何解决它?