Opening an modal dialog box on a browser page, stops the page from redrawing. Scripts started asynchronously run uninterrupted in the background.
I illustrate the be
Those functions are blocking functions. Your JavaScript stops executing until they return.
Your animations and what not in the background are not completely separated from your code calling alert()
. Code that appears to be asynchronous still need to execute in the loop, and if some code blocks that loop, they will not run on their own. This is critical to proper operation of your code.