Code
Content is equivalent to fckeditor1 in your example.
// Get formatted editor content
Function Geteditorcontents (){
VaR Oeditor = Fckeditorapi. getinstance ( " Content " );
Alert (oeditor. getxhtml ( True ));
}
// Insert a specifiedCode
Function Inserthtmltoeditor (codestr ){
VaR Oeditor = Fckeditorapi. getinstance ( " Content " );
If (Oeditor. editmode = Fck_editmode_wysiwyg ){
Oeditor. inserthtml (codestr );
} Else {
Return False ;
}
}
// Count the number of words in the editor
Function Getlength (){
VaR Oeditor = Fckeditorapi. getinstance ( " Content " );
VaR Odom = Oeditor. editordocument;
VaR Ilength;
If (Document. All ){
Ilength = Odom. Body. innertext. length;
} Else {
VaR R = Odom. createRange ();
R. selectnodecontents (Odom. Body );
Ilength = R. tostring (). length;
}
Alert (ilength );
}
// Execute the specified action
Function Executecommand (commandname ){
VaR Oeditor = Fckeditorapi. getinstance ( " Content " );
Oeditor. commands. getcommand (commandname). Execute ();
}
// Set content in the editor
Function Setcontents (codestr ){
VaR Oeditor = Fckeditorapi. getinstance ( " Content " );
Oeditor. sethtml (codestr );
}