I am integrating FCKEditor with the Keyoti spellchecker, on WinXP/Struts/JSP/Tomcat with Firefox. To implement the RSCustomInterface required by Keyoti, I need to fetch and store the innerHTML text from the FCKEditor just before and after spellchecking, and I have two simple Javascript functions, getText and setText, which should do that, but dont quite work, as described below. It is these 2 functions I am requesting help with.
<script>
function RSCustomInterface(tbElementName){
this.tbName = tbElementName; this.getText = getText; this.setText = setText;
function getText(){
return eval(this.tbName+'___Frame.contentWindow.document.body.innerHTML');
}
function setText(text){
eval(this.tbName+'___Frame.contentWindow.document.body.innerHTML = text');
}
}
</script>
This RSCustomInterface function is called with the name of the FCKEditor form field on my JSP page, just docval, not myform.docval.
When these getText and setText functions are used, the spellchecker launches successfully, but with a blank input text, reports no spelling errors found, then on completion it erases the previous value of the FCKEditor, setting it to blank. A secondary behavior is that after the spellcheck, the FCKEditor no longer works, and I can't add any new text to the now-blank input area.
As additional info, the following code for getText and setText works perfectly on IE, but not on FireFox:
function getText(){
return eval(this.tbName+'___Frame.eEditorArea.document.body.innerHTML');
}
function setText(text){
eval(this.tbName+'___Frame.eEditorArea.document.body.innerHTML = text');
}
Further history of this problem and attempts to solve it are available at: http://www.keyoti.com/support/topic.asp?TOPIC_ID=32.
I'm afraid I'm way past my knowledge limit here, as my background is in spacecraft and embedded computing.
Many thanks, in advance, for any assistance!
John Beahan
Wed, 10/05/2005 - 16:56
#1