【发布时间】:2012-03-06 21:56:47
【问题描述】:
您好,很抱歉,这是一个非常大的系统的一部分,如果我遗漏了一些东西,我不会全部说明,请向我索取,
我正在使用 jQuerys ajaxForm http://jquery.malsup.com/form/ 和CKEditorhttp://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 有没有人遇到这个问题并且知道如何解决它?
【问题讨论】:
-
这里多了一个逗号:
success: addonLoader,会破坏 IE -
感谢并修复但不会停止错误