lotus domino下使用FCKeditor

lotus domino下使用FCKeditor,有两种插入方法。

第一种(比较推荐的方法):

HTML首页内容里面加入
"<script type='text/javascript' src='/fck/fckeditor.js'></script>"
//注意路径别写错,FCK编辑器那个文件夹在哪里就写哪里,比如domino里面我把文件夹命名为fck,放入data/domino/html里面,所以这样写。


表单或页面里面用内置HTML写入

<script type ="text/javascript">
var oFCKeditor = new FCKeditor("FCKeditor1");
oFCKeditor.BasePath =  '/fck/'; //这里同上,设置FCK编辑器的目录
oFCKeditor.Create();
</script>


第二种方法(替换Textarea实现):

HTML首页内容里面加入
"<script type='text/javascript' src='/fck/fckeditor.js'></script>"
//注意路径别写错,FCK编辑器那个文件夹在哪里就写哪里,比如domino里面我把文件夹命名为fck,放入data/domino/html里面,所以这样写。


JS Header 里面写入

window.onload = function()
{
var sBasePath = '/fck/'; //这里修改为你网站的fck编辑器文件夹的相对路径
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.ReplaceTextarea();
}


表单或页面里面用内置HTML写入

<textarea name="FCKeditor1" rows="10" cols="80" style="width: 100%; height: 200px"> </textarea>


另附两个获取FCK文本框内容的方法(EditorName传入FCKeditor的名字,比如上面的名字是FCKeditor1)

// 获取编辑器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);
}
posted @ 2011-07-31 09:18  hannover  阅读(473)  评论(0编辑  收藏  举报