首页 > 学院 > 开发设计 > 正文

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

2019-11-14 22:48:12
字体:
来源:转载
供稿:网友
页面可视化编辑ckeditor(web基础学习笔记十五)一、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、页面效果


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表