编辑内联 TinyMCE 后关闭 Fancybox 会产生 WRONG_DOCUMENT_ERR: DOM Exception 4
我有一个 fancybox,它加载一个收集用户输入的表单。这种形式是一个tinyMCE编辑器。我使用 Fancybox 的 onComplete 事件来初始化编辑器,一切正常,直到您在 TinyMCE 中进行任何重要编辑后尝试关闭 Fancybox。无论您点击关闭X,还是让ajaxForm在提交时调用fancybox close方法,都没有关系。
fancybox 关闭,但在删除阴影覆盖之前挂在循环控制台中记录“WRONG_DOCUMENT_ERR:DOM 异常 4”。我尝试禁用叠加层,但没有任何区别。该页面仍然因循环错误而挂起。
Firefox 中也会产生类似的错误。我知道这个错误与尝试从不同元素操作 DOM 节点有关。我怀疑这是因为 DOM 树与向 TinyMCE 添加元素后尝试关闭的 Fancybox 不匹配(添加图像、列表项等会导致这种情况)。
以前有人处理过类似的问题吗?
I have a fancybox that loads a form that collects user input. In this form is a tinyMCE editor. I'm using the onComplete event of Fancybox to init the editor and everything works fine until you try to close the Fancybox after doing any significant editing in the TinyMCE. It doesn't matter if you click the close X, or let ajaxForm call the fancybox close method upon submitting.
The fancybox closes, but hangs in a loop console logging "WRONG_DOCUMENT_ERR: DOM Exception 4" before getting rid of the shadow overlay. I tried disabling the overlay and it made no difference. The page still hangs with the looping error.
Similar errors are produced in Firefox. I understand this error has to do with trying to manipulate DOM nodes from different elements. I suspect it's because the DOM tree doesn't match the one Fancybox is trying to close after adding elements to to the TinyMCE (adding an image, list item, etc causes it).
Has anyone dealt with a similar issue before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我做了一些谷歌搜索但没有找到解决方案,所以经过一些测试后我找到了这个解决方案。
尝试 fancybox 选项中的 onCleanup 命令:
希望有帮助!
I did some googling but didn't find a solution, so after some testing I found this solution.
Try onCleanup command in fancybox options:
Hope it helps!