hhagay
8 years agoContributor
Breaking out of a while loop in JS
Hello Community
Simple put, I'd like to iterate number of times and if the condition is not met, break out. I am using while to allow the object to load (nothing else works....).
What is wrong with this code?
var iter = 2;
link = page.Find("contentText", name, 10);
while (!link.Exists)
{
var i = function iReturn(result)
{
for(i==0; i<=iter; i++)
{
aqUtils.Delay(ms, HelpStr);
return result;
}
}
if (i==iter) break;
}