JSP页面中嵌入UEditor编辑器方法
2017-01-09 00:00
405 查看
<link rel="stylesheet" href="UEditor/themes/default/css/ueditor.css">
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.all.js"> </script>
<!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/lang/zh-cn/zh-cn.js"></script>
<div class="controls"><textarea rows="5" cols="100" style="width: 50%;display: none;" id="txaContent" name="training.content">${meetingWork.content}</textarea>
<script id="scrContent" type="text/plain" style="width:100%;height:355px;">${meetingWork.content}
</script></div>
<script type="text/javascript">
//实例化编辑器//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
var ue = UE.getEditor('scrContent');
function insertHtml() {
var value = prompt('插入html代码', '');
UE.getEditor('editor').execCommand('insertHtml', value)
}
function createEditor() {
enableBtn();
UE.getEditor('editor');
}</script>
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.all.js"> </script>
<!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/lang/zh-cn/zh-cn.js"></script>
<div class="controls"><textarea rows="5" cols="100" style="width: 50%;display: none;" id="txaContent" name="training.content">${meetingWork.content}</textarea>
<script id="scrContent" type="text/plain" style="width:100%;height:355px;">${meetingWork.content}
</script></div>
<script type="text/javascript">
//实例化编辑器//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
var ue = UE.getEditor('scrContent');
function insertHtml() {
var value = prompt('插入html代码', '');
UE.getEditor('editor').execCommand('insertHtml', value)
}
function createEditor() {
enableBtn();
UE.getEditor('editor');
}</script>
相关文章推荐
- EasyUI
- 英文版跨境出口商城系统“远丰集团EXPbuilder”的运用领域和对象群体
- 全面解读远丰BBCbuilder系统五大优势
- 远丰DRPbuilder:企业首选的分销系统
- java quick troubleshooting-java 快速问题诊断工具
- 线程的优先级
- 一个简单的 vue.js 实践教程
- 使用 Vue.js 制作一个简单的调查问卷平台
- vue项目实践(vuex + vue-router + vue-resource)
- 基于Vue的简单的单页面应用
- 基于vue.js和webpack的Chat示例
- Vuejs在v-for中,利用index来对第一项添加class
- 使用 Vuex + Vue.js 构建单页应用
- vue + webpack 起手式
- angular1x初始与架构演进(三)Ui-Router+OcLazyLoad加载模块
- Vue2.0 新手完全填坑攻略—从环境搭建到发布
- es6+webpack+vue项目实践
- Webpack + vue-loader构建单文件vue组件
- 如何使用Ueditor
- Vue.js插件开发入门