我有一段 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
});
});
延迟
声明为:
jQuery.fn.delay = function(time,func){
return this.each(function(){
setTimeout(func,time);
});
};
现在我收到错误:
useless setTimeout call (missing quotes around argument?)
FF3.x、Firefox 6+ 都可以。对此有什么想法吗?为什么会发生这种情况?
最佳答案
我写的时候也遇到同样的错误
setTimeout(updateStatus(), 5000);
而不是
setTimeout(updateStatus, 5000);
关于javascript - 无用的 setTimeout 调用(参数周围缺少引号?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8211005/