Javascript 在iframe中加载CKEDITOR';我不能在firefox中工作

Javascript 在iframe中加载CKEDITOR';我不能在firefox中工作,javascript,html,iframe,ckeditor,Javascript,Html,Iframe,Ckeditor,我正在尝试将整个页面加载到iframe中,并在其中用CKEditor替换div: <body onload="fillframe();"> <iframe id="edit-frame" width="1000" height="1000"></iframe> </body> 这是用“我的页面”填充iframe并替换其中某些内容的功能: $frame = document.getElementById("edit-frame");

我正在尝试将整个页面加载到iframe中,并在其中用CKEditor替换div:

<body onload="fillframe();">
    <iframe id="edit-frame" width="1000" height="1000"></iframe>
</body>

这是用“我的页面”填充iframe并替换其中某些内容的功能:

$frame = document.getElementById("edit-frame");

function fillframe() {

    $win = $frame.contentWindow;
    $doc = $win.document;

    // fill iframe with page
    $doc.body.innerHTML = '<html><head>...</head><body><textarea id="editor"><h1>CONTENT</h1></textarea></body></html>';

    // load the ckeditor script:
    // CKEDITOR has to be loaded inside the
    // window it will be used in
    var script = $doc.createElement("script");
    script.type = "text/javascript";
    script.src = "ckeditor/ckeditor.js";
    $doc.head.appendChild(script);

    // try to replace textarea in iframe
    $win.CKEDITOR.replace("editor");

}
$frame=document.getElementById(“编辑框架”);
函数fillframe(){
$win=$frame.contentWindow;
$doc=$win.document;
//用页面填充iframe
$doc.body.innerHTML=“…内容”;
//加载ckeditor脚本:
//必须将CKEDITOR加载到
//它将在中使用的窗口
var script=$doc.createElement(“脚本”);
script.type=“text/javascript”;
script.src=“ckeditor/ckeditor.js”;
$doc.head.appendChild(脚本);
//尝试替换iframe中的textarea
$win.CKEDITOR.replace(“编辑器”);
}
这在chrome中非常有效,但在firefox中却不行。Firefox将我的框架内的textarea替换为CKEDITOR,但CKEDITOR已完全禁用。Firefox中未加载textarea内的内容:

但我可以通过控制台访问它<例如,code>$win.CKEDITOR.instances.editor返回整个CKEDITOR实例,其中在对象内部显示
状态:loaded

有什么想法吗?有什么问题吗?
提前谢谢

CKEditor已经生成了一个iframe。为什么要将其加载到您自己的iframe中?这是我正在开发的小型CMS的一部分。在后端,整个前端加载在iframe中,内容区域应替换为CKEditor实例,以允许用户“直接在前端”编辑其网站内容。这可能是由于相同的来源政策:iframe的std url是关于:黑色,这与您的网站不同。检查控制台(F12)是否有错误。不幸的是,控制台中绝对没有错误输出。我已经记录了所有的回调函数。在chrome中,每个回调都返回它的事件对象。Firefox不返回它们。只有当我点击其中的一个按钮时,它才会返回一个错误,但我无法真正输入缩小的代码。我现在将尝试github的最新未压缩版本。也许我可以通过调试几个注入点来发现源代码中的错误;将与iframe相同的HTML加载到FF窗口中,并检查是否至少可以正常工作,排除与iframe无关的Firefox一般问题。