I want to alert variable after every 3 seconds if modulus is 0.
but the result is coming like this
5,10,15,20 delay for 3 seconds 5,10,15,20 delay.........and so on
Result i want
5 delay 3 seconds 10 delay 3 seconds 15 delay 3 seconds and so on
The Above issue is solved. Now the issue is that i want to execute a .bat file but it only works for ht first loop value
Here is the updated code
$(document).ready(function(){
var a = 3;
var b = 0;
for (var i = 0; i < 9; i++) {
(function (i) {
setTimeout(function () {
if (i % a == 0) {
var c = b + 5;
b = c;
<?php echo exec('abc.bat'); ?>
} else {
}
}, 3000*i);
})(i);
};
});