Useless setTimeout call (missing quotes around argument?)

kosta5 picture kosta5 · Nov 21, 2011 · Viewed 20.7k times · Source

I have this sniplet of code in jQuery

$element.parent().children().last().hide().show('slide', {direction : 'left'}, 700, function () {
    $element.delay(2000, function() {
        $element.parent().children().last().hide('slide', {direction: 'left'}, 700);             
        reload_table(question_number);
        //delay ends here
    });
});

delay is declared as:

jQuery.fn.delay = function(time,func){
    return this.each(function(){
        setTimeout(func,time);
    });
};

Now I get the error:

useless setTimeout call (missing quotes around argument?)

FF3.x, Firefox 6+ is ok. Any ideas on that? Why could this be happening?

Answer

wsbaser picture wsbaser · Dec 7, 2012

I got same error when I wrote

setTimeout(updateStatus(), 5000);

instead of

setTimeout(updateStatus, 5000);