jenney.qiu

导航

js对FCKeditor取值赋值

获取编辑器中HTML内容,EditorName为控件ID
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) ; 
}

posted on 2012-03-19 18:43  jenney.qiu  阅读(792)  评论(0编辑  收藏  举报