欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JavaScript獲取FCK編輯器信息的具體方法

 更新時間:2013年07月12日 15:17:02   作者:  
這篇文章介紹了JavaScript獲取FCK編輯器信息的實例代碼,有需要的朋友可以參考一下
復制代碼 代碼如下:

    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)計編輯器中內容的字數(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í)行指定動作
function ExecuteCommand(commandName){
    var oEditor = FCKeditorAPI.GetInstance("content") ;
    oEditor.Commands.GetCommand(commandName).Execute() ;
}
//設置編輯器中內容
function SetContents(codeStr){
    var oEditor = FCKeditorAPI.GetInstance("content") ;
    oEditor.SetHTML(codeStr) ;
}

相關文章

最新評論