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前端其它相关文章!