【发布时间】:2014-03-25 16:27:10
【问题描述】:
我从写一个 meteorjs 网页开始。我从排行榜示例开始。这很好用。我添加了一些新功能。我添加了一个 jquery 通知脚本。 (通知http://ned.im/noty/)
当我给一个人五分时,使用此代码激活 Noty 插件
var n = noty({text: txt,timeout: 2000});
......
Template.leaderboard.events({
'click input.inc': function () {
Players.update(Session.get("selected_player"), {$inc: {score: 5}});
notje("Er heeft iemand een score gegeven");
Method.call("callHouse");
},
通知只会显示给我的浏览器,不会显示给其他用户。我如何向所有活动用户使用通知。 用户 -> 服务器 -> 所有用户
希望你能帮我解决这个问题
【问题讨论】:
-
在服务器端
Meteor.users.find({})会给你所有登录的用户。
标签: javascript jquery node.js meteor meteorite