Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 带有按钮的jQuery模式问题中的CKEditor_Javascript_Jquery_Modal Dialog_Ckeditor4.x - Fatal编程技术网

Javascript 带有按钮的jQuery模式问题中的CKEditor

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

我使用的是CKEditor 4.4.7,问题是当我打开包含CKEditor的模式对话框时,我尝试使用背景色或文本颜色按钮,如果我没有从列表中选择任何颜色并关闭它,随后我在控制台中收到错误:

TypeError:a.contentWindow为空TypeError: 此..面板..iframe.getFrameDocument(…).getById(…)为空

这些按钮不再工作了,每当我尝试按下它们时,它们都不会再次打开任何菜单,直到我不再刷新页面

这是我的模态对话框的代码

<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中遇到了“太多递归”错误,但它在大多数情况下都是有效的。如果你有不同的问题,我道歉