FCKeditor is a WYSIWYG text editor that is specifically designed to be in the open source code on a Web page. It is focused on lightweight and does not require too complex installation steps to be used. It can be combined with different programming languages such as PHP, JavaScript, ASP, ASP.net, ColdFusion, Java, and ABAP. The "FCK" in the "FCKeditor" name is the initials of the author of this editor Frederico Caldeira Knabben.
FCKeditor control please go to the official website to download http://www.fckeditor.net, this example is mainly used to Fckeditor_2.6.3.zip, Fckeditor-java-demo-2.4.1.zip, Some of the content inside the fckeditor-java-2.4.1-bin.zip, readers can download themselves.
1. Unpack the compressed package fckeditor_2.6.3.zip, copy the FCKeditor folder to the Web-inf below, which can be used directly after.
2. There are two ways to use FCKeditor in a page.
Mode one: the way of JavaScript
(1) Direct use, see method1.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<body>
方法一:通过JavaScript来实现的实现编辑器导入<br>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor1') ;
oFCKeditor.BasePath = "fckeditor/";
//oFCKeditor.BasePath = "/FCKEditTest/fckeditor/";
oFCKeditor.Width="50%";
oFCKeditor.Height="400";
oFCKeditor.Value="initial value";
//oFCKeditor.ToolbarSet="Basic";
//默认是default
oFCKeditor.ToolbarSet="Default";
oFCKeditor.Create() ;
</script>
</body>
(2) through textarea, Xiang see method2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload=function(){
var oFCKeditor = new FCKeditor('MyTextarea') ;
oFCKeditor.BasePath = "fckeditor/";
//oFCKeditor.BasePath = "/FCKEditTest/fckeditor/";
oFCKeditor.ReplaceTextarea();
}
</script>
<body>
方法二:通过Textarea来实现的实现编辑器导入<br>
<textarea rows="4" cols="60" name="MyTextarea">this is a value</textarea>
</body>