Backbone solve IE ajax cache result

一般來說 Backbone 在針對 model 送 ajax 到後端時使用方法如下:

Backbone.Model.fetch({
success: function(model, response) {
console.log('model = ', model);
},
error: function() {
console.log('error');
}
});
view raw backboneAjax.js hosted with ❤ by GitHub


但在 IE 會針對相同的 ajax request 做 cache,所以必須將 ajax 的 cache 設定為 false,在 backbone 必須要這樣設定:
Backbone.Model.fetch({
cache: false,
success: function(model, response) {
console.log('model = ', model);
},
error: function() {
console.log('error');
}
});


相關連結
http://stackoverflow.com/questions/6178366/backbone-js-fetch-results-cached

沒有留言:

張貼留言