FCKeditor的使用方法
昨天给大家推荐了一个Lightbox,今天再推荐一个网页文字编辑工具FCKeditor,支持IE和Firefox,我以前用的是ewebeditor,由于那个不支持Firefox,所以我最终还是选择了FCKeditor,竞争是不是很残酷。
他的使用方法是很简单的,在从官方下载的文件里面都有相关的说明,并且有10多个实例代码,我给大家举一个例子吧,其他的可以自己去参考FCKeditor下载包里面的实例。
首先你得找到fckeditor.js这个文件,在你的网页文件里面引用这个文件:
<script src="fckeditor.js" type="text/javascript"></script>
然后在你的网页里面再加入一段js代码:
<script type="text/javascript">
<!--
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height = 300 ;
oFCKeditor.Value = 'This is some <b>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.' ;
oFCKeditor.Create() ;
//-->
</script>
<!--
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height = 300 ;
oFCKeditor.Value = 'This is some <b>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.' ;
oFCKeditor.Create() ;
//-->
</script>
里面的FCKeditor1就是你的textarea的名字,在接受数据页面直接获得这个字段就可以。
然后把editor文件夹拷贝到和fckeditor.js的同级目录。
ok,你的FCKeditor就可以运行了,是不是很简单[emot]smile[/emot]
下载地址:
ZIP文件下载
Tar.gz文件下载
Tags: fckeditor, 使用方法 | 1,536 views
如果你觉得IE不好用(微软自己都承认IE的技术不如Firefox),你可以 ,来体验Firefox带给你的超爽感觉。




August 11th, 2007 at 3:55 am
很多地方都是用的这个编辑器
很好用