JS获取FckEditor的值

Posted 海角之上

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JS获取FckEditor的值相关的知识,希望对你有一定的参考价值。

不需要在页面引用任何额外的JS文件

//获取编辑器中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) ;
}

 

以上是关于JS获取FckEditor的值的主要内容,如果未能解决你的问题,请参考以下文章