ckeditor4配置使用
来源:互联网 发布:mysql修改字段名 编辑:程序博客网 时间:2024/06/04 18:11
下载地址:http://ckeditor.com/download
下载时选择Full package
将得到的ckeditor文件夹拷贝到项目的WebRoot文件夹下
编写jsp文件引入ckeditor的js:
<script src="ckeditor/ckeditor.js"></script>
引入jquery的js:
<script src="jquery/jquery-1.4.2.min.js"></script>
第一种方式:
js脚本:
<script type="text/javascript">
$(document).ready(function() {
CKEDITOR.replace('editor1');
});
</script>
编辑区域:
<textarea name="editor1"><p>Initial value.</p></textarea>
第二种方式:
无脚本:
编辑区域:
<textarea class="ckeditor" name="editor1"><p>Initial value.</p></textarea>
默认给出了所有的toolbar,可以修改config.js进行配置:
包含所有toolbar的config.js:
/**
* @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.toolbar =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];
};
解决ie兼容性问题:
将myeclipse自动生成的jsp文件的文档定义:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
换成:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
- ckeditor4配置使用
- ckeditor4.1配置和使用
- ckeditor4.1配置和使用
- ckeditor4.1配置和使用
- ckeditor4.2.1常用配置
- CKEditor4.x部署和配置
- ckeditor4.3工具栏自定义配置
- ckeditor4.5.11+ckfinder_java2.6.2配置
- CKEditor4.x部署和配置
- JSP中使用CKEditor4.6
- ckeditor4.2.1在java中的配置
- CKeditor4.7.3标准版图片上传及相关配置
- 关于CKEditor4.5.6的使用,自定义toolbar配置,上传图片案例(SpringMVC+MyBatis案例),自定义行高,去编辑器的中内容,将编辑器中内容设置到指定的位置等
- HTML编辑器 -- CKEditor4.2(工具栏配置等)与CKFinder2.3整合(上传文件)
- build ckeditor4.0.x
- ckeditor4集成ckfinder2
- ckeditor4.2.2插件应用
- ExtJS4整合CKEditor4.3
- SSAS处理时找不到属性键,由全角字符引起的。
- LeetCode: Word Ladder
- js获取当前系统时间
- 1.J2EE简介&Tomcat
- android中一种不支持的lua操作
- ckeditor4配置使用
- 黑马程序员_java入门_流程控制语句
- Qt创建和使用动态链接库
- HTTP协议详解(真的很经典)
- Twitter与微博
- RAID 0,RAID 1,RAID 10,RAID 5各需几块盘才可组建另附各个raid的结构
- PCI协议的导读
- 微博通介绍
- 软件随想录(local.joelonsoftware.com/wiki)-2002年03月04日 没有事情像表面看起来那么简单 - Nothing is as Simple as it Seems