javascript fckeditor编辑器取值与赋值实现代码
更新时间:2010年05月26日 20:39:47 作者:
这篇文章对于使用fckeditor编辑器的朋友是个不错应用,主要介绍的是js对fckeditor的取值与赋值操作,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) ;
}
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) ;
}
FCKeditor 插件开发
您可能感兴趣的文章:
相关文章
eWebEditor 辑器按钮失效 IE8下eWebEditor编辑器无法使用的解决方法
最近我把IE浏览器更新到了IE8.0,在用eWebEditor在线HTML文本编辑器的时候点击eWebEditor上的所有编辑按钮都没用,只看到浏览器状态栏左下角显示网页上有错误,于是上网查了一下。终于找到解决的方法,测试后正常。2009-06-06
最新评论