Use FCKeditor controls in JSP pages (JS usage)

Source: Internet
Author: User

It can be different from PHP, JavaScript, ASP, ASP. NET, ColdFusion, Java, and ABAP.Programming Language. "Fck" in the "FCKeditor" name is the abbreviation of the author's name Frederico Caldeira knabben.

Download the FCKeditor Control from the official website.Http://www.fckeditor.netYou can download some content in the notebook.

1. Open the compressed package fckeditor_2.6.3.zip, copy the FCKeditor folder to the WEB-INF, which can be directly used later.

2. There are two ways to use FCKeditor on the page.

Method 1: Javascript

(1)for direct use, see method1.html

<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
<HTML>
<Head>
<SCRIPT type = "text/JavaScript" src = "FCKeditor/FCKeditor. js"> </SCRIPT>
</Head>
<Body>
Method 1: Implement editor import through 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 ";
// The default value is default.
Ofckeditor. toolbarset = "default ";
Ofckeditor. Create ();
</SCRIPT>
<HR>
</Body>
</Html>

(2)through textarea, see method2.html

  
     






Method 2: implement editor import through textarea
This is a value

 

Method 2: use FCKeditor

to create an environment before using tags. Copy the slf4j-simple-1.5.2.jar in idea to the lib directory and build the environment.

after the build, you can use it on the JSP page. See method_jsp.jsp

  <% @ page Language =" Java "Import =" Java. util. * "pageencoding =" UTF-8 "%> 
<% @ taglib uri =" http://java.fckeditor.net "prefix =" fck "%>



method_jsp.jsp </ title>


in earlier versions, the value attribute of FCKeditor must be specified, the value cannot be blank.
the version 2.6.3 has been fixed.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.