这是我的一段js代码,上面的start方法和update方法都是LittleMan类中使用prototype定义的方法,现在我想在start方法中每50毫秒调用一次update方法(如上),但是每次都显示this.update is not a function
大神们。。帮帮我啊。。。。
...全文
1528打赏收藏
求助啊。。。js面向对象问题。。T。T
LittleMan.prototype.start = function() { setInterval(function(){ this.update(); },50); } 这是我的一段js代码,上面的start方法和update方法都是LittleMan类中使用prototype定义的方法,现在我想在start方法中每50毫秒调用一次update方法(如上),但是每次都显示this.update is not a function 大神们。。帮帮我啊。。。。