Click here to Skip to main content
14,735,181 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

var t;

function start()

function call()

Some condition i should stop the function call loop. So i am using clearTimeout(t). But its not working. The while loop is still continue. So how to stop the while loop.
Updated 27-Jan-12 2:51am
Rajesh Anuhya 27-Jan-12 7:51am
pre tags added

1 solution

Your while loop will always continue because you are using TRUE. clearTimeout makes no difference because the function has already been called and the while loop is processing. You need to use some other comparison; something like this.

var continue = true;
  if(stop loop)
     continue = false;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900