1、引包
<script>window.UEDITOR_HOME_URL = "${base}/common/ueditor/";</script> <script type="text/javascript" src="${base}/common/js/jquery.form.min.js" ></script> <script type="text/javascript" charset="utf-8" src="${base}/common/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="${base}/common/ueditor/ueditor.all.js"></script> <script type="text/javascript" charset="utf-8" src="${base}/common/ueditor/contentblocks.js"></script>
2、页面中引用
<div class="editer"> <script id="editor" type="text/plain" name="" value="" style="height:300px;width:520px"></script> </div>
3、js加载
$(document).ready(function(){ <!--添加编辑器--> editor = new UE.ui.Editor(); editor.render("editor"); editor.ready(function(){ updateParentIframeHeight(); }) <!--添加编辑器--> });
4、获得富文本中内容
var text = UE.getEditor(‘editor‘).getContentTxt();
时间: 2024-09-29 11:25:30