以javascript方法调用
方法(一)
将fckeditor.jar包拷贝到webroot目录下,新建一html文件,加如一下代码
拷代码(在head内):
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
在body内:
<script type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor');
// http://localhost:8080/fckeditor
// http://localhost:8080/test/fckeditor
oFCKeditor.BasePath = "test/fckeditor/"; // test/是基路径,注意Basepath一定要以斜线结尾
oFCKeditor.Width = "60"; //指定fckeditor的宽度
oFCKeditor.Heigth = "400"; //指定fckeditor的高度
oFCKeditor.Value = "initial value"; //指定fckeditor的初始值
oFCKeditor.ToolBarSet = "Basic"; //指定fckeditor的工具集类型
oFCKeditor.Create();
</script>
方法(二)
将fckeditor.jar包拷贝到webroot目录下,新建一html文件
拷代码(在head内):
<script type="text/javascript" src="fckeditor/fckeditor.js"></script> //src中第一个fckeditor是项目名称
<script type="text/javascript">
window.onload = function(){
var oFCKeditor = new FCKeditor('MyTextarea');
oFCKeditor.BasePath = "fckeditor/";
oFCKeditor.ReplaceTextarea();
}
</script>
在body内加代码:
<TEXTAREA row="4" cols="60" name="MyTextarea">this is value</TEXTAREA>
*********************************
在jsp中通过自定义标签调用:
可以参考:(根据最新版本来定)
1,演示工程fckeditor-java-demo-2.4.war
不能直接查看已经发布后访问到的页面的源码,因为那是个jsp页面,看项目本身的js文档
2,fckeditor-java-2.4的文档(解压fckeditor-java-bin.rar)
1)新建jsp页面
2)拷jar包:fckeditor-java-core.jar(核心jar包),lib下的两个文件上传的和日志的jar包
3)写代码:
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
在body内:
<FCK:editor instanceName="myEditor" basePath="/fckeditor" value="this is my content"></FCK:editor>
//basepath一定要以'/'开头, '/'代表当前工程的路径
//一定要设置value属性的值,并且值不能是空字符串
注:可能会出现缺少类的情况,比较方便的方法是看已提供的demo项目!!
*****************************
配置文件(自定义配置):
1,在fckeditor中有一个fckconfig.js文件,然后可以直接进行相应的修改,一般不采用这种方法,而是采用额外的文件
2,在webroot下见一个myconfig.js文件,只需写需要修改的配置项(参考文档)
FCKConfig.AutoDetectLanguage = false ;
3,
1>在fckeditor中自带的fckconfig.js文件中指定
FCKConfig.CustomConfigurationsPath = '/test/myconfig.js';
2>在页面代码中调用代码对FCKeditor的实例进行配置:
body中的fckeditor中指定: oFCKeditor.Config["CustomConfigurationPath"] = '/test/myconfig.js';
4,重新部署即可
来自:http://blog.163.com/hejian511@126/blog/static/128561078200991310632474/
分享到:
相关推荐
网络上有很多FCKeditor的用法,大多数是互相抄袭,或者...但是这个FCKeditor使用方法详解--图文详解讲解的非常清楚,关键还是附带图片,让人一看就一目了然,很容易看懂。另外还收录了fckeditor的瘦身。很全面的哦--
asp.net文本编辑器FCKeditor使用方法详解
FCKeditor使用方法详解.doc
NULL 博文链接:https://shuaigg-babysky.iteye.com/blog/445698
FCKeditor使用方法技术详解。 FCKeditor是目前最优秀的可见即可得网页编辑器,本文详细介绍其安装,使用FCKEditor的各项功能,常用设置,配置方法; 另外还提供了FCKEditor API,精简FCKEditor文件控件大小的方法。
asp.net文本编辑器FCKeditor使用方法详解.doc
FCKeditor使用方法技术详解.doc
fckeditor和使用方法,可以上传图片,flash
FCKeditor用法 -编辑器
FCKeditor是目前最优秀的可见即可得网页编辑器之一用于文本编辑的工具,支持多种方法调用
FCKeditor是目前最优秀的可见即可得网页编辑器之一,它采用JavaScript编写。具备功能强大、配置容易、跨浏览器、支持多种编程语言、开源等特点。它非常流行,互联网上很容易找到相关技术文档,国内许多WEB项目和大型...
本文特为《PHP5和MySQL5 Web开发技术详解》一书编写
FCKeditor是目前最优秀的可见即可得网页编辑器之一,它采用JavaScript编写。具备功能强大、配置容易、跨浏览器、支持多种编程语言、开源等特点。它非常流行,互联网上很容易找到相关技术文档,国内许多WEB项目和大型...
FCKeditor 2.4.3详细使用方法
...