首頁  >  文章  >  web前端  >  JavaScript取得FCK編輯器資訊的具體方法_javascript技巧

JavaScript取得FCK編輯器資訊的具體方法_javascript技巧

WBOY
WBOY原創
2016-05-16 17:29:051104瀏覽
複製程式碼 程式碼如下:

 "content");
    alert(oEditor.GetXHTML(true));
}
//向編輯器插入指定程式碼
function insertHTMLToEditor(codeStr){ GetInstance("content");
    if (oEditor.EditMode==FCK_EDITMODE_WYSIWYG){
     oEditor.InsertHtml(codeStr);    }
}
//統計編輯器中內容的字數
function getLength(){
    var oEditor = FCKeditorAPI.GetInstance("content");
 ;
    if(document.all){
     iLength = oDOM.body.innerText.length;
    } s(oDOM .body);
     iLength = r.toString().length;
    }
    alert(iLength);
}
/執行指定動作(
    var oEditor = FCKeditorAPI.GetInstance("content") ;
    oEditor.Commands.GetCommand(commandName).Execute() ;
}
//設定編輯器中內容    var oEditor = FCKeditorAPI.GetInstance("content") ;
    oEditor.SetHTML(codeStr) ;
}

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn