码迷,mamicode.com
首页 > 其他好文 > 详细

UEditor

时间:2017-07-15 18:49:21      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:function   img   style   初始化   lan   min   tail   nbsp   frame   

官网:

http://fex.baidu.com/ueditor/

 

1、使用

初始化:

技术分享
<script src="~/ueditor/ueditor.config.js"></script>
<script src="~/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
var ue = UE.getEditor(‘container‘, {
initialFrameWidth: ‘100%‘,
initialFrameHeight:320,
autoHeightEnabled: true,
autoFloatEnabled: true
});
</script>
View Code

 一个配置文件、一个是ueditor的库,然后初始化

使用:

<script id="container" name="content" type="text/plain">这里写你的初始化内容</script>

  

2、大小自动适应

initialFrameWidth: ‘100%‘

3、设置内容

ue.addListener("ready", function() {    //必须这么写,等待编辑器加载完成,否则不能动态加载数据,会报错如下图。
        $.ajax({
            url: "${aapi}/ecosphere/detail/{{id}}",
            success: function(json) {
                 UE.getEditor(‘editor‘).setContent(json.data.content);
            }
        });
    });

 

UEditor

标签:function   img   style   初始化   lan   min   tail   nbsp   frame   

原文地址:http://www.cnblogs.com/xmai/p/7183524.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!