Mostafa Mohamed Mostafa Mohamed - 2 years ago 85
Javascript Question

setTimeout is undefiend why?

i want to disable a button click for a period of time before next click

like when i click it should wait 3 or 5 seconds before next ablity to click it again so i have this piece of code to do so but i don't know why it gives me an error says :

ReferenceError: setTimout is not defined

and the button click one and stop forever.

Here is my code

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);
setTimout(self.$el.attr("disabled", false), 1000);

Answer Source

You made a spelling mistake. It is setTimeout(self.$el.attr("disabled", false), 1000);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download