FckEditor的调用:
方法一:直接用JavaScript调用:
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
</head>
<body>
This is my HTML page. <br>
<script type="text/javascript">
var fckeditor=new FCKeditor('FCKEditor1');//设置编辑器的名字
fckeditor.BasePath="/test/fckeditor/";//这只编辑器的基准路径
fckeditor.Create();//创建并且输出一个编辑器
</script>
方法二:用一个textarea代替,并且在head中加入如下代码:
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.οnlοad=function()
{
var fckeditor=new FCKeditor('mytextarea');
fckeditor.BasePath="fckeditor/";//相对路径,相对于当前页面
fckeditor.ToolbarSet="myself";
fckeditor.Width="70%";
fckeditor.ReplaceTextarea();
document.all.mytextarea.value="";
}
</script>
然后body里加入:
<textarea rows="8" cols="60" name="mytextarea"></textarea><br>
方法三:用FCK标签调用:
首先引入jar包,然后在jsp页面中加入如下内容:
<%@ taglib uri="http://java.fckeditor.net"prefix="FCK"%>
<FCK:editor instanceName="myeditor"value="刘广清欢迎您!" height="400"></FCK:editor>
</body>