http://stackoverflow.com – I have a program whose logic is the same as the dummy sample I've included here. I've tried a simply while (1) which doesn't run (at least the UI is not shown). This sample runs the while loop based on a variable setting which is changed by an addEventListener() which should terminate the loop. However, it acts just as the while (1). (HowTos)