国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > 軟件應(yīng)用 > 正文

fckeditor常用Js,獲取fckeditor內(nèi)容,統(tǒng)計(jì)fckeditor字?jǐn)?shù),向fckeditor寫入指定代碼

2024-09-06 19:16:47
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
content相當(dāng)于你例子中的FCKeditor1。
復(fù)制代碼 代碼如下:

//獲取格式化的編輯器內(nèi)容
function getEditorContents(){
var oEditor = FCKeditorAPI.GetInstance(“content”);
alert(oEditor.GetXHTML(true));
}
//向編輯器插入指定代碼
function insertHTMLToEditor(codeStr){
var oEditor = FCKeditorAPI.GetInstance(“content”);
if (oEditor.EditMode==FCK_EDITMODE_WYSIWYG){
oEditor.InsertHtml(codeStr);
}else{
return false;
}
}
//統(tǒng)計(jì)編輯器中內(nèi)容的字?jǐn)?shù)
function getLength(){
var oEditor = FCKeditorAPI.GetInstance(“content”);
var oDOM = oEditor.EditorDocument;
var iLength ;
if(document.all){
iLength = oDOM.body.innerText.length;
}else{
var r = oDOM.createRange();
r.selectNodeContents(oDOM.body);
iLength = r.toString().length;
}
alert(iLength);
}
//執(zhí)行指定動(dòng)作
function ExecuteCommand(commandName){
var oEditor = FCKeditorAPI.GetInstance(“content”) ;
oEditor.Commands.GetCommand(commandName).Execute() ;
}
//設(shè)置編輯器中內(nèi)容
function SetContents(codeStr){
var oEditor = FCKeditorAPI.GetInstance(“content”) ;
oEditor.SetHTML(codeStr) ;
}
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 观塘区| 遵义市| 马尔康县| 东山县| 永寿县| 晋宁县| 乌审旗| 江西省| 叙永县| 内丘县| 东兴市| 灯塔市| 云安县| 奎屯市| 莲花县| 城步| 开化县| 庆云县| 恩平市| 苏州市| 临邑县| 睢宁县| 微博| 临泽县| 凤山市| 乌鲁木齐市| 贞丰县| 汤阴县| 屏南县| 南华县| 广德县| 西畴县| 顺昌县| 贵阳市| 澜沧| 陵川县| 泰顺县| 罗田县| 商河县| 招远市| 丰宁|