FCKeditor 的简单配置

来源:互联网 发布:no module named yum 编辑:程序博客网 时间:2024/05/09 19:38

1 到官网http://ckeditor.com/download
    下载FCKeditor包
2 解压文件,将fckeditor文件夹考到项目相应位置
  

  
3 打开该文件夹,找到fckeditor.js文件
 根据工程的文件目录配置,修改其中的FCKeditor.BasePath属性值
根据当前的目录修改:


/**
 * This is the default BasePath used by all editor instances.
 
*/

FCKeditor.BasePath 
= 'web/fckeditor/' ;


4 在页面中引用:

      <tr>
            
<td valign="top">内容:</td>
            
<td>

               
<textarea name="content" id="myregist" style="width:100%; height:400px;overflow-x:hidden;">
               </
textarea>
                                            
<script type="text/javascript">
                                            
var oFCKeditor = new FCKeditor( 'myregist' ) ;
                                            oFCKeditor.ToolbarSet 
= 'Default' ;
                                            oFCKeditor.Width 
= '500' ;
                                            oFCKeditor.Height 
= '300' ;
                                            oFCKeditor.Value 
= '' ;
                                            oFCKeditor.ReplaceTextarea();
                                            
</script>
            
</td>
        
</tr>


5 对此页面textarea的name属性进行相应的操作即可