How can I give control back (briefly) to the browser during intensive JavaScript processing?

I have read the post [here][1] about using setTimeout() during intensive DOM processing (using JavaScript), but how can I integrate this function with the below code? The below code works fine for a small number of options, but when the number of options gets too big my "please wait" animated GIF freezes while the local JavaScript is processing. Thanks! function appendToSelect() { $("#mySelect").children().remove() ; $("#mySelect").html( '' ); var j = 1 ; for (var i = 1; i < obj.data.length; i++) { $("#mySelect").append( '' ); } } [1]: http://www.julienlecomte.net/blog/2007/10/28/
tell them to use Chrome and they will have JITted javascript :)

以上就是How can I give control back (briefly) to the browser during intensive JavaScript processing?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏