在线编辑器ckeditor

最近使用在线编辑器ckeditor ,版本是最新3.2

蛮好用的,以前用过TinyMCE,不过,感觉ckeditor配置起来蛮方便的,下了一下它以前的版本,fckeditor ,感觉还是现在的新版本好用,文档也比较全 api:http://docs.cksource.com/ckeditor_api/index.html

使用方法:

1.引用js        ckeditor.js

2.替换文本区域

<script type="text/javascript">

//<![CDATA[

CKEDITOR.replace( 'textareaid');

//]]>

</script>

3.配置config.js 参考api定制

4.删除不需要的文件,如_samples,_source,不需要的lang等等。

【注意】在IE6下的两个小Bug。

1,在非 web上下文的根目录引用时,出现【lang.comment.options为空或不是对象】的错误。

如我的web根目录为 http://localhost:8080/xxxx

则除了在 http://localhost:8080/xxxx/*.jsp  可以引用外,其它路径(http://localhost:8080/xxxx/yy/*.jsp)均出现上面的错误。

解决办法:将ckeditor的相对引用修改成绝对引用。

<script type="text/javascript" src="resource/ckeditor/ckeditor.js"></script>

<script type="text/javascript" src="<c:url value='/resource/ckeditor/ckeditor.js'/>"></script>

2,如果你的textarea外部标签有margin样式的话,可能会出现内容区域被挤到下方。

解决方法:修改样式,如用padding等其它样式实现。

你可能感兴趣的:(html,jsp,Web,fckeditor,tinymce)