【问题标题】:Can't use Medium Editor addElements(elements)不能使用媒体编辑器 addElements(elements)
【发布时间】:2017-02-17 19:11:40
【问题描述】:

我想使用Medium Editor addElements() 函数向我的页面添加一些 html。我真的不知道如何使用它。现在它只是添加了一个可编辑的空白行...

我的代码:

var editor = new MediumEditor('.changeable');
elements = "<section id='"+new_id+"' class='changeable'><h1 class='title_section'>"+newTitle+"</h1><p>This is a new paragraph.</p></section>";
editor.addElements(".container_content",elements);

我的选择器是具有“container_content”类的元素。我想在其中添加 var "elements" 的 html。

谢谢。

【问题讨论】:

    标签: javascript medium-editor


    【解决方案1】:

    好的,我发现了问题。 您必须先创建要添加的元素。然后你调用 .addElements(yourElement)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-13
      • 2014-12-30
      • 1970-01-01
      • 1970-01-01
      • 2014-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多