set time out not working with function

前端 未结 4 1797
予麋鹿
予麋鹿 2021-01-20 03:23

I am using the following to pause the javascript for a few seconds:

 setTimeout(start_countdown(),3000);

It does not work, the function is

4条回答
  •  野的像风
    2021-01-20 04:11

    In different browsers it works in different way. In IE you need to use the anonymous function to pass the parameters to the callback:

    setTimeout(function(){alert('hi')},3000);

提交回复
热议问题