setTimeout是不可取的为什么?

时间:2016-04-20 23:44:58

标签: javascript jquery

我希望在下次点击

之前禁用按钮点击一段时间

就像当我点击它应该在下一个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();
        });
    },
});

1 个答案:

答案 0 :(得分:1)

你犯了拼写错误。它是setTimeout(self.$el.attr("disabled", false), 1000);