【问题标题】:Get contents from Kendo Editor in rich text format从 Kendo Editor 获取富文本格式的内容
【发布时间】:2019-08-31 21:21:36
【问题描述】:

我正在尝试通过电子邮件从剑道编辑器发送数据,但电子邮件显示的是 html 标签。我相信编辑器的内容是 Html,因此,通过设计,它的 value() 方法也返回 Html。我正在努力弄清楚如何从值中获取文本。

在我的函数中,我发送这样的数据: "emailmessagehtml": $("#editor").val(), 但这会显示电子邮件中的所有 html 标签。

如果有人能指出正确的方向以在电子邮件中显示富文本内容,我将不胜感激。

非常感谢

【问题讨论】:

    标签: kendo-ui kendo-editor


    【解决方案1】:

    尝试改用 encodedValue()。

    var editor = $("#editor").data("kendoEditor");
    var content = editor.encodedValue();
    

    Documentation

    也检查https://docs.telerik.com/kendo-ui/api/javascript/ui/editor/configuration/encoded

    $("#editor").kendoEditor({
      value: "<p>foo</p>",
      encoded: false
    });
    

    encoded 表示编辑器是否应该提交编码的 HTML 标签。默认情况下,提交的值是编码的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多