ueditor配置

来源:互联网 发布:spss数据分析培训 编辑:程序博客网 时间:2024/06/05 18:31
<!-- 配置文件 -->
<script type="text/javascript" src="../../ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="../../ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
var ue = UE.getEditor('container', {
    autoHeight: true,
    initialFrameWidth:900,
    initialFrameHeight:500
});


//对编辑器的操作最好在编辑器ready之后再做
ue.ready(function() {
    //设置编辑器的内容
    ue.setContent('hello');
    //获取html内容,返回: <p>hello</p>
    var html = ue.getContent();
    console.log(html);
    //获取纯文本内容,返回: hello
    var txt = ue.getContentTxt();
    console.log(txt);
});
</script>
0 0