FCKeditor编辑器

来源:互联网 发布:多系统引导软件 编辑:程序博客网 时间:2024/04/30 15:47
// 获取编辑器中HTML内容 
function getEditorHtmlContents(name,isClearP){

//获取多文本编辑框的对象
   var oEditor = FCKeditorAPI.GetInstance(name);
   //获取用户输入的内容
   var acontent = oEditor.GetXHTML();
  if(isClearP){
 //过滤掉多文本编辑框增加的<p></p>
 acontent=acontent.substr(3,acontent.length-7);
  }
  
   return acontent;
}




// 获取编辑器中文字内容 
function getEditorTextContents(EditorName) { 
var oEditor = FCKeditorAPI.GetInstance(EditorName); 
return(oEditor.EditorDocument.body.innerText); 



// 设置编辑器中内容 
function SetEditorContents(EditorName, ContentStr) { 
var oEditor = FCKeditorAPI.GetInstance(EditorName) ; 
oEditor.SetHTML(ContentStr) ; 
}
原创粉丝点击