当前位置:主页 > >

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

时间:2020-10-05 21:32:18 | 栏目: | 点击:

获取编辑器中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 插件开发

您可能感兴趣的文章:

相关文章