D
diogoko
I have some code like:
try {
someButton.disabled = true;
cpuIntensiveCode();
} finally {
someButton.disabled = false;
}
The problem is that someButton is never disabled, because the browser
is busy thinking in cpuIntensiveCode. Indeed, if I don't reenable
someButton in the finally part, it waits until cpuIntensiveCode is over
to disable someButton.
The only way to disable someButton before cpuIntensiveCode is to force
the browser to redraw the window (eg: by putting an alert(...) just
after someButton is disabled).
I don't want a useless alert popping every time I run cpuIntensiveCode.
Does someone know a way to force the redraw of the browser window (not
reloading the page, just redrawing it)?
try {
someButton.disabled = true;
cpuIntensiveCode();
} finally {
someButton.disabled = false;
}
The problem is that someButton is never disabled, because the browser
is busy thinking in cpuIntensiveCode. Indeed, if I don't reenable
someButton in the finally part, it waits until cpuIntensiveCode is over
to disable someButton.
The only way to disable someButton before cpuIntensiveCode is to force
the browser to redraw the window (eg: by putting an alert(...) just
after someButton is disabled).
I don't want a useless alert popping every time I run cpuIntensiveCode.
Does someone know a way to force the redraw of the browser window (not
reloading the page, just redrawing it)?