removing alert causes the system to not work. This issue was raised here
response = exchange.load_response();
// alert(response);
document.getElementById(exchange.get_output()).innerHTML = response;
// alert(response);
setTimeout('do_branding()',3000);
but I don’t see how it was resolved
That seems to be a race condition…
setTimeoutwon’t solve it since it doesn’t wait with the rest of the JS, it just makes the call after the amount of time you tell it to…You should either use a callback (this solves the problem completely) OR if that is not possible and you really want to solve the race condition by waiting then there are several ways to implement that
sleepfunction – see for a callback-based example http://juixe.com/techknow/index.php/2005/10/28/put-javascript-to-sleep/