ITeye博客

FCKeditor - JS操作FCKeditor

topsale · 2011-04-12 12:13 · 其它框架 · Web前端 · Markdown

东西不多,却必须要用到。

代码如下:


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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。