I have an html file that includes CKEditor.replace and I load it into an iframe when the frameset loads: This works fine. I can then load data into the editor like so:
var iframe = document.getElementById('editFrame')
myEditor=iframe.contentWindow['CKeditor1'];
myEditor.insertHtml(data);
I now want to dynamically load the iframe like so:
iframe.src="ckeditor/myFile.html";
myEditor=iframe.contentWindow['CKeditor1'];
myEditor.insertHtml(data);
The iframe loads with the editor, but the insertHtml fails. I think it's because the code runs before the edtior has finished loading.
In the same function, how can I accomplish loading the page containing the editor and insert data into the editor?
var iframe = document.getElementById('editFrame')
myEditor=iframe.contentWindow['CKeditor1'];
myEditor.insertHtml(data);
I now want to dynamically load the iframe like so:
iframe.src="ckeditor/myFile.html";
myEditor=iframe.contentWindow['CKeditor1'];
myEditor.insertHtml(data);
The iframe loads with the editor, but the insertHtml fails. I think it's because the code runs before the edtior has finished loading.
In the same function, how can I accomplish loading the page containing the editor and insert data into the editor?
Re: Dynamically load ckeditor and doc in iframe
iframe.src="ckeditor/myFile.html";
iframe.onload=function(){
myEditor=iframe.contentWindow['CKeditor1'];
myEditor.insertHtml(data);
}