Jquery plugins 主干视图中的jQuery插件raty.js不断从服务器重新加载相同的星形图像
每当我将鼠标悬停在某个页面上的wbotelhos/raty.js插件上时,它会随着星星的开关从服务器上反复获取star-on.png和star-off.png。有没有一种方法可以使用图像的本地客户端缓存?我正在测试Chrome。我使用下面的主干.View呈现代码将插件插入到Item元素中Jquery plugins 主干视图中的jQuery插件raty.js不断从服务器重新加载相同的星形图像,jquery-plugins,backbone.js,raty,Jquery Plugins,Backbone.js,Raty,每当我将鼠标悬停在某个页面上的wbotelhos/raty.js插件上时,它会随着星星的开关从服务器上反复获取star-on.png和star-off.png。有没有一种方法可以使用图像的本地客户端缓存?我正在测试Chrome。我使用下面的主干.View呈现代码将插件插入到Item元素中 render: function(manage) { this.collection.each(function(user) { this.insertView("ul", new User.Vie
render: function(manage) {
this.collection.each(function(user) {
this.insertView("ul", new User.Views.Item({
model: user
}));
}, this);
return manage(this).render().then(function(el) {
// Only re-focus if invalid
this.$("input.invalid").focus();
this.$(".raty-test").raty();
});
}
为了解决这个问题,我从wbotelhos/raty编写了github:charlesjshort/raty,用setSource函数替换设置图像源的代码,该函数将图像设置为本地存储阵列中的对象。我使用github:doomhz/jQuery映像缓存将映像预加载到本地存储阵列中