Content is equivalent to the FCKeditor1 in your example.
Copy Code code as follows:
Get the formatted editor contents
function geteditorcontents () {
var oeditor = fckeditorapi.getinstance ("content");
Alert (oeditor.getxhtml (true));
}
Inserts the specified code into the editor
function Inserthtmltoeditor (CODESTR) {
var oeditor = fckeditorapi.getinstance ("content");
if (OEDITOR.EDITMODE==FCK_EDITMODE_WYSIWYG) {
Oeditor.inserthtml (CODESTR);
}else{
return false;
}
}
Count the number of contents 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);
}
Perform a specified action
function ExecuteCommand (commandName) {
var oeditor = fckeditorapi.getinstance ("content");
OEditor.Commands.GetCommand (CommandName). Execute ();
}
Setting the contents of the editor
function Setcontents (CODESTR) {
var oeditor = fckeditorapi.getinstance ("content");
Oeditor.sethtml (CODESTR);
}