js与Fckeditor的交互

in 未分类

blog的编辑器用的是FckEditor
总体来说感觉还是很不错的
但有时需要用js来获取FckEditor中的值
直接用document.getElementById(‘fckeditor’).value是得不到的
正确的获取方法:
var  oEditor  =  FCKeditorAPI.GetInstance(‘editor’) ;
alert(
oEditor.GetXHTML(true));

js修改FckEdior的值:
var  oEditor  =  FCKeditorAPI.GetInstance(‘editor’) ;
oEditor.
SetHTML(‘新内容’);
alert(oEditor.GetXHTML(true));

更多相关内容见这里:
http://www.blogjava.net/itstarting/archive/2007/03/11/103142.html

ps.codeproject上的GmailUpload_demo.zip

点击下载压缩文档 [GmailUpload_demo]

1 Comment

One Comment

  1. 回来就谈技术

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>