一个简单的FCKEditor步骤

第一步:首先打开下载的fckEditor目录_samps下面的default.html


第二部:打开页面查看框架源代码 复制form里面的内容


<form action="../php/sampleposteddata.php" method="post" target="_blank">
<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.href.substring(0,document.location.href.lastIndexOf('_samples')) ;


var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height = 300 ;
oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a 


href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ;
oFCKeditor.Create() ;
//-->
</script>
<br />
<input type="submit" value="Submit" />
</form>
第三:新建一个html网页,把上面的加进去。
接着
<!-- 导入js文件 -->
<script type="text/javascript" src="fckeditor.js"></script>


第四部:修改form里面的内容:

<form action="" method="post" target="_blank">


<textarea name="content"></textarea>
<script type="text/javascript">
<!--


var oFCKeditor = new FCKeditor( 'content' ) ;//里面的参数一定要和textarea的name名字相同,否则不能替换


oFCKeditor.BasePath = "./" ;//当前editor的目录,必须以“/”结束
oFCKeditor.Height = 300 ;
oFCKeditor.Value = '显示的默认值' ;
//oFCKeditor.Create() ;//创建一个FCKEditor
oFCKeditor.ReplaceTextarea()//替换上面的textarea使其能在网页上用
</script>
<br />
<input type="submit" value="Submit" />
</form>
第五部:完成测试

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值