Why is setTimeout(fn, 0) sometimes useful?

http://stackoverflow.com/questions/779379/why-is-settimeoutfn-0-sometimes-useful

 

jquery validation

 

setTimeout(function() {
   $('#my_field').rules('add', { required: true })
}, 0);

  

posted @ 2016-08-09 13:55  Mose  阅读(125)  评论(0编辑  收藏  举报