Jump to content

kody

Members
  • Posts

    1
  • Joined

  • Last visited

kody's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I have a function that calls another function inside a "for" loop. The second function uses setInterval() to display and update a countdown clock on the web page. The user sets the time on the countdown clock in minutes, and also sets the number of times the loop will operate (how many countdown clocks). I want the code in the first function to wait until the clock reaches zero before continuing. function firstFunction(){ for(I=1; I<count; I++){ some code... secondFunction(); more code... } My one idea was to create a global variable/flag with a "while" loop with nothing inside the brackets just after calling the second function. In the second function, I would set the flat to "Y" when the timer reaches zero. But, the web page just locks up. while (flag=="N"){ }; Help would be appreciated.
×
×
  • Create New...