【问题标题】:Chrome Browser Uncaught TypeError in Handlebars TemplateHandlebars 模板中的 Chrome 浏览器未捕获 TypeError
【发布时间】:2014-07-31 22:26:22
【问题描述】:

您好,我正在使用以下代码通过车把模板显示持续时间。但是Chrome浏览器提示错误:

未捕获的类型错误:无法读取未定义的属性“替换”

请帮助我做错了什么。

JSON:

duration : ["monthly", "yearly"]

模板:

{{#each duration}}
    <input type="radio" name="duration" id="{{.}}" class="mLZero {{#ifCond . 'monthly'}}ns-month {{else}}ns-year {{/ifCond}}" />
    <label type="radio" name="duration" for="{{.}}"  class="fCaps mR10 {{#ifCond . 'monthly'}}ns-month {{else}}ns-year {{/ifCond}}">{{.}}</label>
{{/each}}

【问题讨论】:

    标签: javascript jquery json handlebars.js


    【解决方案1】:

    我相信您可能会遇到此处记录的问题:https://github.com/wycats/handlebars.js/issues/830,这是 Google Chrome 36 特有的问题。

    【讨论】:

    • 感谢您的回复。我已经注意到这个链接,他们说问题将在 Google Chrome 38 中修复。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-17
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-31
    相关资源
    最近更新 更多