Fckeditor使用方法
来源:互联网 发布:键盘windows键解锁 编辑:程序博客网 时间:2024/05/21 19:32
测试Fckeditor版本为:2.6.3
目前Fckeditor只能用于基于ie内核的浏览器,如果要使用于chrome等浏览器,请使用ckeditor。
具体使用方法:
1.将解压后的fckeditor整个文件夹复制到Project的WebRoot路径下
2.在要使用Fckeditor的页面,导入fckeditor.js(在fckeditor文件夹里)文件
因为此处使用Fckeditor用到了jQuery,因此相应的jquery.js也要导入
<script language="javascript" src="${pageContext.request.contextPath}/script/jquery.js"></script><script language="javascript" src="${pageContext.request.contextPath}/fckeditor/fckeditor.js" charset="utf-8"></script>
3.根据需要适当修改以下JS代码,复制到要使用Fckeditor的页面即可
<script type="text/javascript">$(function(){var fck = new FCKeditor("content");//content为要替换的textarea的name属性fck.Width = "99%";fck.Height = "100%";fck.ToolbarSet = "bbs";//指定工具栏的配置,bbs为我自己修改过的,如果不使用自定义配置文件,此处有Default,Basic两个选择fck.BasePath = "${pageContext.request.contextPath}/fckeditor/";fck.ReplaceTextarea();});</script>
替换成Fckeditor的textarea,名字和上面的替换的名字要一致。
<textarea name="content" style="width:650px;height:200px"></textarea>
PS:代码解释
JS代码中各个参数具体作用(使用本js或者上文使用方法步骤3的代码都可以,两段代码大同小异)
<script type="text/javascript">var oFCKeditor = new FCKeditor( 'content' ) ;//此参数会作为提交表单时的参数名oFCKeditor.BasePath= "/fckeditor/" ;//一定要指定editor文件夹所在的路径,并且要以'/'结尾oFCKeditor.Height= 300 ;//高度oFCKeditor.Value= '' ;//默认的初始值oFCKeditor.ToolbarSet="Basic";//指定工具栏的配置,默认为Default//oFCKeditor.Create() ;//在当前位置生成并显示FckeditoroFCKeditor.ReplaceTextarea();//替换指定id或name属性的textarea为Fckeditor</script>
使用自定义的配置文件
1.在fckconfig.js里将FCKConfig.CustomConfigurationsPath = ''修改为: FCKConfig.CustomConfigurationsPath = FCKConfig.EditorPath + "myconfig.js" 作用:告诉Fckeditor,我有个自定义的配置在该地址下的该文件。
2.在myconfig.js里写想修改的东西,例如:表情,Fckeditor菜单栏的减少等,模版在fckconfig.js里面有,参考着修改即可。没有修改的配置,Fckeditor默认使用自己的默认配置。
3 0
- FCKeditor使用方法
- FCKeditor使用方法
- FCKeditor使用方法
- FCKeditor使用方法
- FCKEditor 使用方法
- FCKEditor 使用方法
- Fckeditor使用方法
- Fckeditor使用方法
- Fckeditor使用方法
- FCKeditor使用方法小结(php)
- FCKeditor 的使用方法
- FCKeditor使用方法小结
- ,NET中FCKeditor使用方法
- FCKeditor使用方法技术详解
- FCKEditor 的使用方法
- FCKeditor .Net 使用方法
- FCKeditor(asp.net)使用方法
- FCKeditor(CKeditor)使用方法
- 多级指针
- JAX-WS - 基础示例
- 多线程编程实例:不带缓冲的多线程文件复制
- mysql 命令mysqldump使用注意
- WCF学习-构建WCF服务(3)
- Fckeditor使用方法
- 一个判别表达式中开、闭括号是否配对出现的算法
- 微信公众帐号开发教程第6篇-文本消息的内容长度限制揭秘
- Ubuntu下自动加载U盘
- ubuntukylin安装nvidia的双显卡切换驱动--大黄蜂Bumblebee
- 杭电1163
- 有序链表插入与删除——C语言
- 黑马程序员 类的加载、连接、初始化
- 2-SAT暴力dfs模板解释|不看你会后悔的