lotus domino下使用ckeditor

本文详细介绍了如何在LotusDomino环境下使用FCKeditor进行内容编辑,包括两种常见集成方法:直接引入JavaScript文件和通过内置HTML与JS代码实现。同时提供了获取编辑器内容的两种方法。

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); 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值