I'm trying to load ckEditor 3.2 inside an Ajax snippet like this:
Website global (outside Ajax snippet):
Inside Ajax snippet:
As soon as I call the Ajax snippet the second time, I'll get JavaScript error "i.contentWindow is null". From the third time on it works again. Any idea why?
Besides, is there maybe a better way to work with ckEditor inside asynchronously loaded content? I'd especially get rid of custom global JavaScript vars. The ajax.html inside the ckEditor's _samples folder actually doesn't give a clue about it.
Thanks in advance,
Roman
Website global (outside Ajax snippet):
var ckEditorText = null;
Inside Ajax snippet:
...
<textarea name="text" class="ckeditor"></textarea>
...
<script type="text/javascript">
if (ckEditorText) {
ckEditorText.destroy();
ckEditorText = null;
}
ckEditorText = CKEDITOR.replace('text');
</script>
As soon as I call the Ajax snippet the second time, I'll get JavaScript error "i.contentWindow is null". From the third time on it works again. Any idea why?
Besides, is there maybe a better way to work with ckEditor inside asynchronously loaded content? I'd especially get rid of custom global JavaScript vars. The ajax.html inside the ckEditor's _samples folder actually doesn't give a clue about it.
Thanks in advance,
Roman

Re: i.contentWindow is null
if (CKEDITOR.instances['text']) { CKEDITOR.remove(CKEDITOR.instances['text']); } CKEDITOR.replace('text');The way it's done in _samples/Ajax.html is definitely not working (for us) in a real Ajax setup.
Re: i.contentWindow is null
Those code snippets doesn't show any clue about what's the difference between your code and the provided samples, so it's not possible to fix any bug.
Re: i.contentWindow is null
Attachments:
Re: i.contentWindow is null
Re: i.contentWindow is null
Re: i.contentWindow is null
CKEDITOR.replace( id, {removePlugins : "wordcount" } );
You can easily implement your own wordcount with some jquery and event handlers on the keyup and paste events in the editor.