用js调用fckeditor,在编辑时如何得到fck的内容 - 技术问答
展开全部
利用Javascript取和设FCKeditor值也是非常容易的,如下://
获取编辑器中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)
;}你在ppc一搜就有了,上面这个
获取编辑器中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)
;}你在ppc一搜就有了,上面这个
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询