fckeditor是一个功能强大的在线的富文本HTML编辑器,下面来简单介绍一下他的使用:
1 下载fckeditor,现在地址为:http://www.fckeditor.net/
2 解压下载的文件
3 新建一个html网页,在开头加入:
<script src="fckeditor/fckeditor.js"></script>
4 初始化文本编辑器:
<script language="javascript">
var oFCKeditor = new FCKeditor( 'yourEditorName' ) ;
oFCKeditor.BasePath = '/testenv/fckeditor/' ;
oFCKeditor.ToolbarSet = 'Default' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '500' ;
oFCKeditor.Value = '' ;
oFCKeditor.Create() ;
</script>
5 得到编辑器中的内容:
var oEditor = FCKeditorAPI.GetInstance('yourEditorName' );
var content = oEditor.GetXHTML(true);
6 设置编辑器中的内容
var oEditor = FCKeditorAPI.GetInstance('yourEditorName' );
oEditor.SetHTML('content');