我使用Meteor在Meteor.setTimeout()上做了一个示例.在这个例子中我得到一个错误.我对此没有任何想法.所以请看下面的代码,错误并建议我怎么办?
错误:
Exception in setTimeout callback: TypeError: undefined is not a function at _.extend.withValue (http://localhost:3000/packages/meteor.js?8ec262df25783897eaad01255bc8bd1ca4e78b24:773:17) at http://localhost:3000/packages/meteor.js?8ec262df25783897eaad01255bc8bd1ca4e78b24:358:45 at http://localhost:3000/packages/meteor.js?8ec262df25783897eaad01255bc8bd1ca4e78b24:801:22
JS代码:
if (Meteor.isClient) { Meteor.setTimeout(Test("10"),1000); Meteor.setInterval(Test1,1000); Template.hello.greeting = function () { return "Welcome to timerapp."; }; Template.hello.events ({ 'click input' : function () { // template data,if any,is available in 'this' if (typeof console !== 'undefined') console.log("You pressed the button"); //Test(); } }); } function Test(x) { console.log("*** Test() ***"+x); } function Test1() { console.log("*** Test1() ***"); } if (Meteor.isServer) { Meteor.startup(function () { // code to run on server at startup }); }