Javascript 将Jquery Raty与Meteor一起使用
我试图在模板呈现的回调中添加由数据库中的字段填充的星级。我相信问题是raty找不到这些图像,但我很难让它工作。图像当前位于App/public/img中,回调中的raty代码为:Javascript 将Jquery Raty与Meteor一起使用,javascript,jquery,meteor,raty,Javascript,Jquery,Meteor,Raty,我试图在模板呈现的回调中添加由数据库中的字段填充的星级。我相信问题是raty找不到这些图像,但我很难让它工作。图像当前位于App/public/img中,回调中的raty代码为: Template.game.rendered = function() { $('.game-rating').raty({ readOnly: true, numberMax : 5, path: App/public/img, score: function() {
Template.game.rendered = function() {
$('.game-rating').raty({
readOnly: true,
numberMax : 5,
path: App/public/img,
score: function() {
return $(this).attr('data-score');
},
starOff: 'star-off.png',
starOn: 'star-on.png'
});
Try path:/img流星中的公用文件夹被视为/
您可能还需要引用它。路径:'/img',Dang仍然是空的。只是无法让图像出现。