首页 > Web开发 > 详细

jsp调用fckeditor

时间:2014-09-22 13:47:54      阅读:274      评论:0      收藏:0      [点我收藏+]
将FCKeditor目录拷贝到工程中。
 
调用fckeditor
(1)使用JavaScript来调用。有两种方式。
 
 
第一种:直接调用方式。
步骤1:引入JS文件。
<script   type="text/javascript" src="fckeditor/fckeditor.js"></script>    
步骤2:
<script type="text/javascript">    var oFCKeditor = new FCKeditor( ‘FCKeditor1‘   ) ;    oFCKeditor.BasePath  = "fckeditor/" ;    oFCKeditor.Create() ;</script>    
 
第二种:通过替换多行文本框。
步骤1:引入JS文件。
<script   type="text/javascript" src="fckeditor/fckeditor.js"></script>    
步骤2:创建多行文本框
<textarea rows="10"   cols="40" name="content"></textarea>    
步骤3:
<script type="text/javascript">    window.onload = function()    {       var oFCKeditor = new FCKeditor(‘content‘) ;       oFCKeditor.BasePath  = "fckeditor/"   ;       oFCKeditor.ReplaceTextarea() ;    }</script>    
 
 
(2)通过JSP自定义标签来调用。
步骤1:导入jar包。
步骤2:导入标签库。
<%@taglib   uri="http://java.fckeditor.net" prefix="FCK" %>    
步骤3:
<FCK:editor   instanceName="myFckeditor" basePath="/user/fckeditor"   value=" "></FCK:editor>


jsp调用fckeditor

原文:http://my.oschina.net/gslsz/blog/316574

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!