[英]TinyMCE Draws Okay, But Won't Let Me Type In It. In FF, Buttons Have Error: Component returned failure code: 0x80004005
在以前的应用程序中,我能够让TinyMCE正常工作。 但是在这个网络应用程序中,我得到了丰富的编辑器以显示正常,但由于某种原因我无法输入到富编辑器字段,当我点击一个像粗体一样的按钮时,我收到此错误:
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://mysite/tiny_mce/tiny_mce.js :: anonymous :: line 1" data: no]
Source File: http://mysite/tiny_mce/tiny_mce.js
Line: 1
我想知道我可以做些什么来调试这里发生的事情。 什么可能导致这个奇怪的错误?
一些背景:
此代码加载TinyMCE:
<script type="text/javascript" src="http://mysite/tiny_mce/tiny_mce.js"></script>
<script>
tinyMCE.init({
mode : 'none',
editor_selector: 'mceAdvanced',
theme : 'advanced',
theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
theme_advanced_buttons1 : 'fontsizeselect,bold,italic,|,bullist,numlist,|,outdent,indent,|,removeformat',
theme_advanced_buttons2: '',
theme_advanced_buttons3: '',
theme_advanced_font_sizes: "1, 2, 3, 4",
width: '600',
height: '200',
remove_script_host : true,
cleanup_on_startup : true,
cleanup: true,
debug : true,
convert_urls : false
});
tinyMCE.execCommand('mceAddControl', true, 'fldOverview');
</script>
<textarea id="fldOverview" name="fldOverview" class="textbox"><?= OVERVIEW ?></textarea>
测试:
FF3失败了。 Opera(最新稳定版)有效。 Windows IE7有效。 Safari(最新稳定版)有效。
答案就在这里 。
这笔交易就是这样。 有没有使用Facebook? 我们尝试实现类似的界面,您单击该界面来编辑配置文件部分,它会使用进度条折叠并重新展开,然后使用配置文件表单折叠和重新展开。 在该配置文件表单中,我们使用了TinyMCE丰富的编辑器。
好吧,事实证明,有一个隐藏DIV的怪癖然后显示出来显示TinyMCE控件。 它得到了关闭或什么? 无论如何,我们在jQuery中使用slideToggle API来折叠并重新扩展DIV,其中包含我们通过jQuery AJAX提取的新内容。 当我们这样做时,不知何故,这个slideToggle API给我们带来了麻烦。
解决方法是像往常一样进行slideToggle,但在我们使用execCommand技术加载tinyMCE编辑器之前,我们需要在jQuery中使用show API来确保我们的DIV首先被强制打开和可见。 当我们这样做时,问题就消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.