Useless setTimeout call (missing quotes around argument?)

前端 未结 5 1948

I have this sniplet of code in jQuery

$element.parent().children().last().hide().show(\'slide\', {direction : \'left\'}, 700, function () {
    $element.delay(20         


        
5条回答
  •  时光取名叫无心
    2021-02-12 20:16

    I agree with wsbaser. I had the additional instance of needed to pass information to the function, and for simplicity used:

    setTimeout(function(){ updateStatus(myData) } , 5000);
    

    The argument needs to be a function and not a function being called. Firefox caught this error, chrome let it go.

提交回复
热议问题