FCKEditor的赋值和取值操作
1、获取编辑器中HTML内容
  function getEditorHTMLContents(EditorName)
function getEditorHTMLContents(EditorName)
 {
{ 
 var oEditor = FCKeditorAPI.GetInstance(EditorName);
    var oEditor = FCKeditorAPI.GetInstance(EditorName); 
 return(oEditor.GetXHTML(true));
    return(oEditor.GetXHTML(true)); 
 }
} 
2、获取编辑器中文字内容(在博客发布时获取无html代码摘要使用)
  function getEditorTextContents(EditorName)
function getEditorTextContents(EditorName)
 {
{ 
 var oEditor = FCKeditorAPI.GetInstance(EditorName);
    var oEditor = FCKeditorAPI.GetInstance(EditorName); 
 return(oEditor.EditorDocument.body.innerText);
    return(oEditor.EditorDocument.body.innerText); 
 }
} 
3、设置编辑器中内容
  function SetEditorContents(EditorName, ContentStr)
function SetEditorContents(EditorName, ContentStr)
 {
{ 
 var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
    var oEditor = FCKeditorAPI.GetInstance(EditorName) ; 
 oEditor.SetHTML(ContentStr) ;
    oEditor.SetHTML(ContentStr) ; 
 }
}
 function getEditorHTMLContents(EditorName)
function getEditorHTMLContents(EditorName) {
{  var oEditor = FCKeditorAPI.GetInstance(EditorName);
    var oEditor = FCKeditorAPI.GetInstance(EditorName);  return(oEditor.GetXHTML(true));
    return(oEditor.GetXHTML(true));  }
}2、获取编辑器中文字内容(在博客发布时获取无html代码摘要使用)
 function getEditorTextContents(EditorName)
function getEditorTextContents(EditorName) {
{  var oEditor = FCKeditorAPI.GetInstance(EditorName);
    var oEditor = FCKeditorAPI.GetInstance(EditorName);  return(oEditor.EditorDocument.body.innerText);
    return(oEditor.EditorDocument.body.innerText);  }
}3、设置编辑器中内容
 function SetEditorContents(EditorName, ContentStr)
function SetEditorContents(EditorName, ContentStr) {
{  var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
    var oEditor = FCKeditorAPI.GetInstance(EditorName) ;  oEditor.SetHTML(ContentStr) ;
    oEditor.SetHTML(ContentStr) ;  }
} 
                    
                     
                    
                 
                    
                
 

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号