一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

设置fck焦点及获取fck编辑器内容 长度 js代码

时间:2010-09-08 编辑:简简单单 来源:一聚教程网

本教程主要讲了怎么利用js 来设置编辑器获得焦点获取fck编辑器内容判断是否为空,以及内容长度与js调用fck编辑器的方法。

var checkcontent =fckeditorapi.getinstance("content").getxhtml();


写成函数

function geteditorhtmlcontents(editorname) {
var oeditor = fckeditorapi.getinstance(editorname);
return(oeditor.getxhtml(true));


编辑器获得焦点

var oeditor = fckeditorapi.getinstance('content');  
oeditor.focus(); 

写成函数

// 设置编辑器焦点

function seteditorcontents(editorname, contentstr) {
var oeditor = fckeditorapi.getinstance(editorname) ;
oeditor.focus;
}

上面方法简单写

长度验证:
fckeditorapi.getinstance("content").getxhtml().length;
另外还要让编辑器获得焦点:

var oeditor = fckeditorapi.getinstance('content');oeditor.focus();


fckeditor js调用方法




fck推荐下载地址

http://down.111com.net/webedit/2009/0429/fck-dedecms.html

 

热门栏目