Run your JavaScript in a well-timed sequence.