摘要: 原文来自JohnResighow-javascript-timers-work如图所见,当有js代码在执行时,回调函数会被加入带待执行的队列,当js执行间隔或UI事件执行的间隔,才执行等待队列的回调var test = function(){ setTimeout(function(){ console.log('timer'); }, 0); console.log('common');} test();//common//timer另外,setTimeout 和 setInterval 的区别 setTimeout(function(){ /* Some l 阅读全文
posted @ 2012-02-07 14:30 王冶soda 阅读(295) 评论(0) 推荐(1) 编辑