Hello, I have a particular page that uses lots of widgets that have to be initialized by Javascript routines (around 400, it's a complex one). This takes some time (even 20 secs on slower machines). Now I was thinking I could show a progress indicator (a simple text field with a percentage label), instead of the page, but I discovered that even if I was updating it continuosly, the ongoing task blocks everything and I see no updates. So everything remains frozen until the heavy javascript task completes. I even done the following experiment, but freezes as well (and firefox says that the script is taking too long to complete...):
function a(){
for (var i = 0; i < 5000000000000000; i++){
abb = i;
}
}
var abb;
function c(){
var ef = document.getElementById("pip");
ef.innerHTML = abb;
}
function b(){
setInterval(c, 50);
setTimeout(a, 1000);
}
The only solution that comes to me is to break down the long job in pieces and update the label.... but I was wondering if there is another solution! God, JS needs threads as soon as possible... :)
Any ideas?