您的位置:首页 > 其它

页面可视化编辑ckeditor(web基础学习笔记十五)

2015-01-30 00:54 447 查看

一、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、页面效果

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: