javascript fckeditor编辑器取值与赋值实现代码

(编辑:jimmy 日期: 2024/9/20 浏览:2)

获取编辑器中HTML内容
复制代码 代码如下:
function getEditorHTMLContents(EditorName)
{
var oEditor = FCKeditorAPI.GetInstance(EditorName);
return(oEditor.GetXHTML(true));
}

获取编辑器中文字内容
复制代码 代码如下:
function getEditorTextContents(EditorName)
{
var oEditor = FCKeditorAPI.GetInstance(EditorName);
return(oEditor.EditorDocument.body.innerText);
}

设置编辑器中内容
复制代码 代码如下:
function SetEditorContents(EditorName, ContentStr)
{
var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
oEditor.SetHTML(ContentStr) ;
}

FCKeditor 插件开发