整合FCKEditor到项目中

xiaoxiao2022-06-14  39

以JavaScript方式整合 1.到[url]http://www.fckeditor.net/download[/url]下载FCKeditor 2.6.4.1的zip压缩包 2.将解压后的fckeditor文件夹整个复制到你的web项目的WebRoot根目录下 3.验证是否安装成功:在IE地址栏输入: http://<your site>/<FCKeditor installation path>/_samples/default.html进行验证 如:http://localhost/你的项目名/fckeditor/_samples/default.html 出现fckeditor的编辑页面说明安装成功 4.引入到你的jsp页面中 4.1 在你的jsp页面中加入 <script type="text/javascript" src="fckeditor/fckeditor.js"></script> 4.2在<head></head>标签之间加入 <script type="text/javascript">window.onload = function(){var oFCKeditor = new FCKeditor( [color=red]'MyTextarea'[/color] ) ;oFCKeditor.BasePath = "/fckeditor/" ;oFCKeditor.ReplaceTextarea() ;}</script> 注:这是在你的jsp页面中有了一个testArea,你希望在这个testArea中用fckeditor来显示。 [color=red] MyTextarea [/color]要和你的testArea的id一致 [color=red] "/fckeditor/"[/color]改为[color=red]"/你的项目名/fckeditor/"[/color] 5.ok,fckeditor已经整合到项目中了,当然了,你还以配置显示的样式,工具栏,根据自己需要 参照官方文档就ok了 [color=red]oFCKeditor.ToolbarSet = '' [/color]//设置工具栏 [color=red]oFCKeditor.Height=[/color] //设置高度 ...... 还可以在fckeditor.js中的FCKConfig.FontSizes配置中文字体,注意修改后一定要保存问UTF-8编码 否则中文名称会显示乱码。 相关资源:Java 面经手册·小傅哥(公众号:bugstack虫洞栈).pdf
转载请注明原文地址: https://www.6miu.com/read-4936575.html

最新回复(0)