zoukankan      html  css  js  c++  java
  • UEditor编辑器第一次赋值失败的解决方法

    网上查了很多方式都不是很好用,最后想到了这样的处理方式

    首先在js中定义一个全局变量

    var ue = null;

    然后在初始化显示编辑器的时候js这样写 

    if (ue == null) {
    ue = new baidu.editor.ui.Editor();
    ue.render('email_template');
    }
    ue.setContent("11111");

    这样就可以第一次的时候正常显示编辑器的值

    --初始化赋值 避免js报错

    var ue = UE.getEditor('txtContent', {
    toolbars: [
    ['bold', 'italic', 'underline', 'fontborder', 'justifyleft', 'justifycenter',
    'justifyright', 'justifyjustify']
    ]
    });
    ue.addListener("ready", function () {
    // editor准备好之后才可以使用
    ue.setContent('abc');
    });

  • 相关阅读:
    排序算法之归并
    RequestAndResponse
    Jsp相关
    会话技术
    MVC设计思想
    FileRecv VNCViewer 使用方法
    Go语言string包详解
    Go语言字符串
    Go语言fmt包详解
    编写第一个Go程序
  • 原文地址:https://www.cnblogs.com/hgmyz/p/7465812.html
Copyright © 2011-2022 走看看