开发者

setTimeout(fun) with a single argument? (Timeout not specified)

开发者 https://www.devze.com 2022-12-28 03:37 出处:网络
The HTML5 specifications states that setTimeout can be run without the additional \"timeout\" argument which is supposed to say after how many milliseconds will the function \"handler\" be scheduled.

The HTML5 specifications states that setTimeout can be run without the additional "timeout" argument which is supposed to say after how many milliseconds will the function "handler" be scheduled.

handle = window . setTimeout( handler [, timeout [, arguments ] ] )
   Schedules a timeout to run handler after timeout milliseconds. Any arguments are passed straight through to the handler.

However, I failed to find anywhere which explains what happens when no "timeout" time period is set.

An example usage is, the animation implementation int the Raphael library.

animationElements[length] && win.setTimeout(a开发者_如何学运维nimation);


See http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#get-the-timeout

  1. Let timeout be the second argument to the method, or zero if the argument was omitted.
0

精彩评论

暂无评论...
验证码 换一张
取 消