JSP页面中嵌入UEditor编辑器方法

<link rel="stylesheet" href="UEditor/themes/default/css/ueditor.css">javascript

<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.config.js"></script>css

<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.all.js"> </script>html

       <!--建议手动加在语言,避免在ie下有时由于加载语言失败致使编辑器加载失败-->java

       <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,好比你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->闭包

<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>htm

<script id="scrContent" type="text/plain" style="width:100%;height:355px;">${meetingWork.content}ip

                                                                            </script></div>utf-8

 

<script type="text/javascript">get

//实例化编辑器//建议使用工厂方法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>

相关文章
相关标签/搜索