阻止Mustache从缓存加载模板

时间:2013-07-02 13:50:45

标签: backbone.js mustache

我正在使用带有mustache.js的Backbone.js,我正在使用ajax加载我的模板。我的问题是模板是从缓存加载的(如果重要的话,使用ctrl + F5刷新!)。现在我已对模板进行了更改,但它仍在加载旧版本的模板。它隐姓埋名的工作非常好。有办法防止这种情况吗?也许阻止Mustache缓存模板?

呈现模板的代码是:

$.get(this.templatesPath + this.template, function(resTemplate){
        var html = Mustache.render(resTemplate, that.personData);
        that.$el.html(html);
    });

我的第一个想法是使用一些其他功能而不是“Mustache.render()”,就像“Mustache.to_html()”。但看着 源代码 揭示to_html()只调用render()。

有什么想法吗?

0 个答案:

没有答案
相关问题