1: 将FCKeditor_2.4.3.rar解压
2将FCKeditor_2.4.3.rar解压出来的单独放到一个文件夹名FCKeditor中 如下这些文件
3 在html文件中加入
想要的编辑器 可以再sample找比如我想要这样的
则把sample2的例子程序的核心代码copy下来 放到想要的jsp文件中
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ;// '/fckeditor/' is the default value.
// var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
var sBasePath ="<%=request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() +"/fckeditor/"%>";
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath= sBasePath ;
oFCKeditor.ReplaceTextarea() ;
}
</script>
</head>
<body>
<textarea name="FCKeditor1" rows="10" cols="20"></textarea>
</body>
</html>