Home >Backend Development >PHP Tutorial > jquery 怎么获取fckeditor的内容

jquery 怎么获取fckeditor的内容

WBOY
WBOYOriginal
2016-06-13 13:29:37868browse

jquery 如何获取fckeditor的内容?
我用

JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->var content = $("#FCKeditor1").val()

获取不到

查看过源文件,editor的id是FCkeditor

求赐教

------解决方案--------------------
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) ;
}


……
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn