jsp中嵌入fckeditor编译器

来源:互联网 发布:项目经理 知乎 编辑:程序博客网 时间:2024/06/05 19:45

下载fckeditor,网址:http://ckeditor.com/demo/
问题一:嵌入jsp中
1.在<head></head>标签中引入<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
2.然后加入
   <script type="text/javascript">
   //创建FCKeditor 
   window.onload = function()
   {
     var oFCKeditor = new FCKeditor( 'content') ;
     oFCKeditor.BasePath = "/MyBlog/fckeditor/" ;
     oFCKeditor.ToolbarSet='Default';//订制工具栏Basic或Default
     oFCKeditor.Height=400;//高度
     oFCKeditor.ReplaceTextarea() ;//替换textarea 
   }
  </script>

  <textarea id="MyTextarea" name="MyTextarea">This is <b>the</b> initial value.</textarea>
问题二:如何加入中文字体
解答:在fckconfig.js中,FCKConfig.FontNames =   'Arial;Comic   Sans   MS;Courier   New;Tahoma;Times   New   Roman;Verdana '   ;
  在之后增加宋体,黑体,隶书,楷体_GB2312之类的字体名称
 

原创粉丝点击