I was having a look at some code a friend did and stumbled across this line which I thought was an error (simplified for example)..
for (g = 0; 10 > g; g+
your for loop runs 10 times but wont alert anything since you have put ;
;
that alert you are getting is only once because of that statement outside of for loop