Javascript 带有按钮的jQuery模式问题中的CKEditor
我使用的是CKEditor 4.4.7,问题是当我打开包含CKEditor的模式对话框时,我尝试使用背景色或文本颜色按钮,如果我没有从列表中选择任何颜色并关闭它,随后我在控制台中收到错误: TypeError:a.contentWindow为空TypeError: 此..面板..iframe.getFrameDocument(…).getById(…)为空 这些按钮不再工作了,每当我尝试按下它们时,它们都不会再次打开任何菜单,直到我不再刷新页面 这是我的模态对话框的代码Javascript 带有按钮的jQuery模式问题中的CKEditor,javascript,jquery,modal-dialog,ckeditor4.x,Javascript,Jquery,Modal Dialog,Ckeditor4.x,我使用的是CKEditor 4.4.7,问题是当我打开包含CKEditor的模式对话框时,我尝试使用背景色或文本颜色按钮,如果我没有从列表中选择任何颜色并关闭它,随后我在控制台中收到错误: TypeError:a.contentWindow为空TypeError: 此..面板..iframe.getFrameDocument(…).getById(…)为空 这些按钮不再工作了,每当我尝试按下它们时,它们都不会再次打开任何菜单,直到我不再刷新页面 这是我的模态对话框的代码 <form act
<form action='' method='post'>
<textarea id='editor1' name='editor1'></textarea>
<script type="text/javascript">
CKEDITOR.replace('editor1');
</script>
<input type="submit" name="submitComment" value="Submit" />
</form>
CKEDITOR.replace('editor1');
问题是什么?如何解决?谢谢。这听起来与此处描述的问题类似: 在这里: (此处描述的解决方案似乎不再有效) 我的解决办法如下:
orig_allowInteraction = $.ui.dialog.prototype._allowInteraction;
$.ui.dialog.prototype._allowInteraction = function(event){
// address interaction issues with general iframes with the dialog
if (event.target.ownerDocument != this.document[0]){
return true;
}
// address interaction issues with dialog window
if ($(event.target).closest(".cke_dialog").length){
return true;
}
// address interaction issues with iframe based drop downs in IE
if ($(event.target).closest(".cke").length){
return true;
}
return orig_allowInteraction.apply(this, arguments);
};
这个解决方案并不完美,因为我在Firefox中遇到了“太多递归”错误,但它在大多数情况下都是有效的。如果你有不同的问题,我道歉