I’m running this little piece of Javascript:
if(path.length >= 7000){
alert("OVER 7000");
}
In this script, path.length is a variable which begins at 0 and increments to 7000 (and beyond) – further details aren’t relevant.
What I want is that the alert message appears only once when the 7000 value is met and then fires no more. (At the moment, I get an incessant stream of alerts once 7000 is met.)
Is there a way of doing this?
Simple flag to determine if you’ve alerted:
Or if you post how you’re looping and incrementing
path.length, you can probably do something with awhileloop and abreak.