Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery plugins 主干视图中的jQuery插件raty.js不断从服务器重新加载相同的星形图像_Jquery Plugins_Backbone.js_Raty - Fatal编程技术网

Jquery plugins 主干视图中的jQuery插件raty.js不断从服务器重新加载相同的星形图像

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

每当我将鼠标悬停在某个页面上的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.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映像缓存将映像预加载到本地存储阵列中