1. Download FCKeditor. There are many examples in the directory for viewing. What I need is JSP-related code, which can be greatly simplified and irrelevant content can be deleted.
2. The simplified directory can be found in my download resources.
3.there is a sample.html file in the resource. The file is short. The simplified content is as follows:
Code:
- <HTML>
- <Head>
- <Link href = "sample.css" rel = "stylesheet" type = "text/CSS"/>
- <SCRIPT type = "text/JavaScript" src = "FCKeditor. js"> </SCRIPT>
- <SCRIPT type = "text/JavaScript">
- Window. onload = function (){
- VaR sbasepath = "";
- VaR ofckeditor = new FCKeditor ('fckeditor1 ');
- Ofckeditor. basepath = sbasepath;
- Ofckeditor. replacetextarea ();
- }
- </SCRIPT>
- </Head>
- <Body>
- <Form action = "destination. jsp" method = "Post" target = "_ blank">
- <Div>
- <Textarea name = "fckeditor1" rows = "10" Cols = "80" style = "width: 100%; Height: 200px"> This textarea name is very important </textarea>
- </Div>
- <Br/>
- <Input type = "Submit" value = "Submit"/>
- </Form>
- </Body>
- </Html>
Note that:
(1) The function called by window. onload during file loading is sbasepath = "FCKeditor directory ";
(2) The parameter passed when the FCKeditor object is generated should be the name of the textarea you want to replace.
4.create a new fckeditordirectory under the webrootdirectory, copy the files to this directory, and then copy the code in sample.html to the desired location.