当前位置:编程学习 > JS >>

js如何获得FCKeditor控件的值

js如何获得FCKeditor控件的值,如何设置FCKeditor控件的值
答案:利用Javascript取和设FCKeditor值也是非常容易的,如下: 

// 获取编辑器中HTML内容 
function getEditorHTMLContents(EditorName) { 
var oEditor = FCKeditorAPI.GetInstance(EditorName); 
return(oEditor.GetXHTML(true)); 
} 

// 获取编辑器中文字内容 
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) ; 
}

上一个:请问 ASP response.write JS问题
下一个:用js限制投票的cookie .目前设置的为:<input type="" class="" onclick="'window.location...

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,