I have several functions that may or may not need to be repeated a certain number of times. The number of times is set by the user, and is stored in a variable: xTcount.
if (xTcount > 0) {
for (i=0; xTcount <= i; i++) {
$(document).miscfunction();
}
}
I haven’t actually tested the script above, as i’m sure it’s incorrect. What makes what i want tricky, is that i don’t want to have to code a “check xTcount” clause into every function that is repeatable. if possible, i’d like to create some master checker that simply repeats the next-called function xTcount times…
Repeat some things
xTcounttimes? Maybe I’m misunderstanding, but it looks pretty simple:If the trouble is that you don’t like the look of the
forloop, or that your script requires you to build the same loop multiple times, you could extract it if you reeeaaallllly wanted to: