以下代码(*)有效,但我不想使用:
$(this.el).html(Mustache.render("<h2>{{title}}</h2>", view));
我想要做:
$(this.el).html(Mustache.render("somePath/myFile.html", view));
我该怎么做?
(*)
render: function ()
{
var view = {
response: this.model.title
};
$(this.el).html(Mustache.render("<h2>{{{title}}}</h2>", view)); // it works
$(this.el).html(Mustache.render("myFile.html", view)); // it does not work
},