Javascript 传递调用方法的结果时出现异常-Meteor

Javascript 传递调用方法的结果时出现异常-Meteor,javascript,meteor,Javascript,Meteor,我的服务器端代码 Meteor.methods({ 'doCount': function(){ var x = ProductList.find().count(); console.log(x); return x; } }); 我的客户端代码是 Meteor.call('doCount', function(error, result) { console.log("lenght of counters variable is "+

我的服务器端代码

 Meteor.methods({
  'doCount': function(){
      var x = ProductList.find().count();
      console.log(x);
      return x;
  }
});
我的客户端代码是

Meteor.call('doCount', function(error, result) {

    console.log("lenght of counters variable is "+counters.length);
    var queryResult = ProductList.find().fetch();
    for(i=0 ; i< result; i++){
        console.log("current Time >>> "+ TimeSync.serverTime();
        console.log("expire Time "+ queryResult[i].expire);
          }

});
Meteor.call('doCount',函数(错误,结果){ log(“counters变量的长度为”+counters.length); var queryResult=ProductList.find().fetch(); 对于(i=0;i>>”+TimeSync.serverTime(); log(“过期时间”+queryResult[i].expire); } }); 虽然chrome浏览器每次都会返回正确的日志,但Firefox的行为很奇怪。这是屏幕截图


我还使用包进行
TimeSync.serverTime()
函数调用。

是否有理由指望服务器并获取
ProductList
客户端中的项目?注释掉
TimeSync.serverTime()时会发生什么情况
part?嗯,我正在尝试一个便士拍卖应用程序的原型。因此,我需要当前拍卖中运行的产品数量,并根据这一点,我需要许多倒计时计时器才能脱机运行。但是为什么不调用
ProductList.find().count()呢
客户端?您的代码意味着所有
ProductList
的文档都是公共的。(
var queryResult=ProductList.find().fetch();
queryResult[i]
)如果我按照您的建议去做,我想这还是解决不了我的问题。我在获取
TimeSync.serverTime()时遇到了麻烦
value那么你是说
TimeSync.serverTime()
在FF中不工作?你试过从FF开发控制台运行它吗?