如何使用ueditor

来源:互联网 发布:虚拟机运行mac os x慢 编辑:程序博客网 时间:2024/04/30 13:01

</pre><span style="font-size:18px; color:#ff0000"><strong>1、标签中</strong></span><p></p><p></p><pre name="code" class="html"> <textarea id="MsgCon" rows="50" cols="180" ></textarea>

2、js中初始化

 var ue = UE.getEditor('MsgCon', {            //设置按钮            focus: true, //上来就聚焦            enableAutoSave: false, //启用自动保存            elementPathEnabled: false,            autoHeightEnabled: false,            scaleEnabled: false,            initialFrameWidth: "100%",            initialFrameHeight: 230, //初始高度500            zIndex: 0        });

3、js中赋值
editor准备好之后才可以使用!!!这点很重要

UE.getEditor('MsgCon').addListener("ready", function () {<span style="white-space:pre"></span>            // editor准备好之后才可以使用<span style="white-space:pre"></span>            UE.getEditor('MsgCon').setContent(msgdata.MsgCon);<span style="white-space:pre"></span>        });

4、js中取值

  var content = UE.getEditor('MsgCon').getContent();


1 0
原创粉丝点击