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 插件开发
您可能感兴趣的文章:
相关文章
FCKeditor 2.6 编码错误导致修改的内容出现乱码的解决方法
我修改了该文件,其中有些中文字,在 IE 中打开之,发现是乱码,原来这个文件有问题。文件中指定了 charset 为 utf-82010-03-03
ckeditor syntaxhighlighter代码高亮插件配置分享
现在大家可以不必像我这样为了实现代码高亮的功能,去修改ckeditor编辑器,大家可以去使用百度编辑器(Ueditor)他有代码高亮的功能,还蛮好用的,我的个人网站就是的百度编辑器的。欢迎大家去我的博客看看2014-12-12


最新评论