【问题标题】:Mustache.to_html method returing me empty String ("")?Mustache.to_html 方法返回空字符串(“”)?
【发布时间】:2013-07-02 08:16:25
【问题描述】:

当我使用 Mustache.to_html 方法时,它会返回空字符串 (“”) 。但是当我调试代码并使用检查点继续前进时,我得到的模板, 为什么我会出现这种行为? 我的代码是这样的-

    var temp = $.get(/templates/mytemplate);
    var data = {
               name : "john",
   };
    var html = Mustache.to_html(temp,date);

我得到html"" 但通过使用breakpoing 我得到了正确的html。为什么?

【问题讨论】:

标签: javascript html templates mustache


【解决方案1】:
var temp = $.get(/templates/mytemplate);
    var data = {
               name : "john",
   };
var html = Mustache.to_html(temp,data);

存在拼写错误,例如日期而不是数据..

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-13
    相关资源
    最近更新 更多