Chinaunix首页 | 论坛 | 博客
  • 博客访问: 204151
  • 博文数量: 48
  • 博客积分: 1935
  • 博客等级: 上尉
  • 技术积分: 491
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-29 00:59
文章分类

全部博文(48)

文章存档

2011年(1)

2010年(47)

我的朋友

分类:

2010-11-04 04:04:35

FCKeditor获取内容以及赋值

JavaScript 2007-10-24 22:49:53 阅读307 评论0   字号: 

1、获取编辑器中HTML内容

function getEditorHTMLContents(EditorName)

{

var   oEditor = FCKeditorAPI.GetInstance(EditorName);

return(oEditor.GetXHTML(true));

}

2、获取编辑器中文字内容(在博客发布时获取无html代码摘要使用)

function getEditorTextContents(EditorName)

{

var oEditor = FCKeditorAPI.GetInstance(EditorName);

return(oEditor.EditorDocument.body.innerText);

}

3、设置编辑器中内容

function SetEditorContents(EditorName,ContentStr)

{

var oEditor = FCKeditorAPI.GetInstance(EditorName);

oEditor.SetHTML(ContentStr);

}

 

阅读(1273) | 评论(1) | 转发(0) |
0

上一篇:Use FCKeditor in Python

下一篇:fckeditor

给主人留下些什么吧!~~

chinaunix网友2010-11-05 08:43:36

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com