0

So I wish to loop the javascript going to a certain page (without actually reloading/clearing console), then execute

href="javascript:doSomething(9)" 

and then loop that by doing a function

Please help, thanks!

Y I
  • 19
  • 2

1 Answers1

1

Assuming you want it to repeat - you can use an interval.

setInterval(function(){
    doSomething(9);
},100); // the 100 is for 100 miliseconds

If you want it to repeat without having to wait (that is, block the code) you can use a normal while loop:

while(true){ // will loop forever since the condition is always "true"
    doSomething(9);
}
Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504