Javascript Mustache.render()和Mustache.to_html()之间有什么区别?

Javascript Mustache.render()和Mustache.to_html()之间有什么区别?,javascript,mustache,Javascript,Mustache,没有提到Mustache.to_html(),但是每个for Mustache.js online都使用Mustache.to_html()。因此,我肯定丢失了一些珠宝 非常感谢代码示例 看看,html基本上已经被弃用了: // This is here for backwards compatibility with 0.4.x. exports.to_html = function (template, view, partials, send) { var result = ren

没有提到Mustache.to_html(),但是每个for Mustache.js online都使用Mustache.to_html()。因此,我肯定丢失了一些珠宝

非常感谢代码示例

看看,html基本上已经被弃用了:

// This is here for backwards compatibility with 0.4.x.
exports.to_html = function (template, view, partials, send) {
    var result = render(template, view, partials);

    if (typeof send === "function") {
      send(result);
    } else {
      return result;
    }
};

正如您所看到的,它调用render。一个区别是额外的(可选)send参数,它是它调用的回调(将结果作为参数发送)。

非常感谢。对我来说,很好的一课就是开始看源代码。