settimeout issue in IE8

后端 未结 2 726
轻奢々
轻奢々 2021-01-20 15:58

I am facing a strange issue while using javascript setTimeout function in IE8. I want to use the \'setTimeout\' function like this -

setTimeout(timeout,2000         


        
2条回答
  •  无人及你
    2021-01-20 16:19

    Probably not supported there, so have this instead:

    window.setTimeout(function() {
        timeout({name:'saarthak'});
    },2000);
    

    Meaning call your function from within anonymous function.

提交回复
热议问题