With the former version of FCKeditor, i used the following javascript code to dynamically add text to the editor:
window.frames[0].objContent.DOM.selection.clear();
window.frames[0].objContent.DOM.selection.createRange().pasteHTML("text");
unfortunately, this isn't working anymore with 2.0, how do I have to alter the code to work with 2.0?
window.frames[0].objContent.DOM.selection.clear();
window.frames[0].objContent.DOM.selection.createRange().pasteHTML("text");
unfortunately, this isn't working anymore with 2.0, how do I have to alter the code to work with 2.0?
RE: Access FCKeditor via Javascript to add te
Short answer,
fckObjInstance.SetHTML('the html');
you can test this in your browser by pasting this in the address bar.
goto http://www.fckeditor.net/demo/default.html then paste...
javascript: alert(this.FCKeditorAPI.__Instances['FCKeditor1'].SetHTML('asdasd'))
So basically if you can manage to get ahold of the editor instance from FCKeditorAPI.__Instances you can call SetHTML()
Not sure if this quite what you're after... hope it helps.
RE: Access FCKeditor via Javascript to add te
editor_frame = document.getElementById(editorname+'___Frame');
editor_source = editor_frame.contentWindow.document.getElementById('eEditorArea');
editor_source.contentWindow.document.body.innerHTML += 'some text';