Hey,
I'm trying to load a full page into an iframe and replace a div with an CKEditor in that:
<body onload="fillframe();"> <iframe id="edit-frame" width="1000" height="1000"></iframe> </body>
This is the function to fill the iframe with my page and replace some content inside:
$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"); }
This works perfectly in chrome, but not in firefox. Firefox replaces the textarea inside my frame with the CKEDITOR, but CKEDITOR is completely disabled.The content inside of the textarea is not loaded in firefox:
But i can access it via console. $win.CKEDITOR.instances.editor
for example
$win.CKEDITOR.instances.editor
returns me the whole CKEDITOR instance, where it says inside the object.
Any ideas, what could be the problem? Thanks in advance!
Greets
Chris
I'm having the same problem -
I'm having the same problem - did you get anywhere with this?