日期:2014-05-17  浏览次数:20476 次

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) ;
}


……