I'm using the firebug console to test a script... Right at the start of my script i have an option on the number of times i want the script to run!
My problem is:
- The script stops after a while, without completing, if i put a big number!
notes:
- If i put under 10 times, it runs always!
- If i put 20 times, sometimes it runs 'till the end, some times it doesn't!
- If i put over 20 times, it never ends properly!
- Each time it runs, it takes between 1 to 6 minutes...
- I checked the code, the logic seams ok
- It runs! it does everything! just not more than 20 times... i need it to run much more than that :\
example of code:
var x = prompt("How many times should this script be runned?");
alert("It will be runned " + x + " times then!");
function doThis() {
setTimeout(function(){
...;
++n;
--x;
action();
},65000);
}
function doThat() {
setTimeout(function(){
...;
++n;
--x;
action();
},65000);
}
function action() {
if(x>0) {
if(...) {
if(n<6){
doThis();
}
} else {
if(n<6){
doThat();
}
}
} else {
alert("The Script has ended!");
}
action();