javascript fckeditor编辑器取值与赋值实现代码
程序员文章站
2022-06-23 21:49:09
获取编辑器中html内容 复制代码 代码如下: function geteditorhtmlcontents(editorname) { var oeditor = fck...
获取编辑器中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 插件开发