我希望在下次点击
之前禁用按钮点击一段时间就像当我点击它应该在下一个ablity之前等待3或5秒再次点击它所以我有这段代码这样做但我不知道为什么它给我一个错误说:
ReferenceError: setTimout is not defined
然后按钮点击一个并永远停止。
这是我的代码
module.SynchNotificationWidget = module.StatusWidget.extend({
template: 'SynchNotificationWidget',
start: function(){
var self = this;
this.pos.bind('change:synch', function(pos,synch){
self.set_status(synch.state, synch.pending);
});
this.$el.click(function(){
setTimout(self.$el.attr("disabled", false), 1000);
self.pos.push_order();
});
},
});
答案 0 :(得分:1)
setTimeout(self.$el.attr("disabled", false), 1000);