jquery怎么获取fckeditor的内容
时间:2021-07-01 10:21:17
帮助过:3人阅读
jquery 如何获取fckeditor的内容?
我用
JScript code
var content = $("#FCKeditor1").val()
获取不到
查看过源文件,editor的id是FCkeditor
求赐教
------解决方案--------------------
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) ;
}
……