liunanjava

一、CKedit下载ckedit

下载地址:http://ckeditor.com/

二、ckedit的引入

2.1、解压并将ckedit复制到项目中

2.2、在页面中引入

在页面头部加入

<script type="text/javascript" src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"></script>

2.3、在需要使用ckedit的标签中添加class="ckeditor"

多行文本域添加class

tr>
    <td>内容</td>
    <td>
    <textarea id="newscontent" name="newscontent" class="ckeditor" rows="8"></textarea>
    </td>
</tr>

2.4、页面全部代码

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!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=UTF-8">
<script type="text/javascript" src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"></script>
<title>Insert title here</title>
</head>
<body>
<table >
<tr>
    <td>标题</td>
    <td><input type="text" name="title" value=""/></td>
</tr>
<tr>
    <td>内容</td>
    <td>
    <textarea id="newscontent" name="newscontent" class="ckeditor" rows="8"></textarea>
    </td>
</tr>
</table>

</body>
</html>

2.5、页面效果

 

分类:

技术点:

相关文章:

  • 2021-07-17
  • 2021-10-28
  • 2021-04-11
  • 2021-09-09
  • 2021-08-18
  • 2021-10-31
猜你喜欢
  • 2021-11-11
  • 2021-05-18
  • 2021-12-11
  • 2021-05-19
相关资源
相似解决方案