<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
???<title></title>
???<meta name="decorator" content="default" />
???<script type="text/javascript" src="${ctxStatic}/ckeditor_4.7.3_full/ckeditor/ckeditor.js"></script>
???<script type="text/javascript">
???????$(document).ready(function () {
???????????alert("he");
??????????$("#hel").click(function () {
???????????????alert("hello");
???????????????var ckIns=CKEDITOR.instances.cktext;
???????????????alert("ckIns"+CKEDITOR.instances.cktext.getData());
???????????});
???????});
???</script>
</head>
<body>
hello
<textarea name="cktext" cols="30" rows="10"></textarea>
<button type="button" id="hel" class="btn btn-primary">获取值</button>
<script type="text/javascript">
???CKEDITOR.replace("cktext", {
???????width: 950, height: 400, toolbar:
???????????[
???????????????//撤销 ?重做 ?样式 ??????格式 ?????字体 ???字体大小 ?加粗 ????斜体, ??穿过线 ???????数字列表 ?????????实体列表 ???????????减小缩进 ???增大缩进 超链接 取消超链接 锚点 图片 ????表格 ???文本颜色 ????背景颜色 //全屏 ??????????显示区块
???????????????[‘Undo‘,‘Redo‘,‘Styles‘, ‘Format‘, ‘Font‘, ‘FontSize‘, ‘Bold‘, ‘Italic‘, ‘Strike‘,‘RemoveFormat‘, ‘NumberedList‘, ‘BulletedList‘, ‘-‘, ‘Outdent‘, ‘Indent‘, ‘Link‘, ‘Unlink‘, ‘Table‘, ‘TextColor‘, ‘BGColor‘, ‘Maximize‘,‘SpellChecker‘,‘-‘]
???????????],
???????placeholder:‘enter换行(行距较大),shift+enter换行(正常换行)‘
???});
</script>
</body>
</html>
ckeditor 前段js配置toolbar以及取值(实用)
原文地址:http://www.cnblogs.com/austinspark-jessylu/p/7851203.html