I’m running a loop in javascript that should take about a minute to complete. When I click the link that is supposed to activate the loop, the page makes no effort to load anything but when I comment the loop out, print statements work. Does javascript just know the process is going to take a while and not do it and if it does is there anyway to make it not do this? Thank you!
PS here’s the code (script array is over 60000 entries long):
function magic(charnumber) {
var count = 1;
alert(charnumber);
var output = "";
for (count; count < scriptAr.length; count += 4) {
if (scriptAr[count] < charnumber and sriptAr[count + 1] > charnumber) {
output = output + scriptAr[count + 2] + '\n';
}
}
alert(charnumber);
}
I think its just failing because of the syntax error
andshould be&&.