读书人

jquery 怎么获取fckeditor的内容

发布时间: 2012-05-31 12:19:24 作者: rapoo

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


……

读书人网 >PHP

热点推荐