I'm about to make some JS functionality that will
- execute one function for previously predefined number of times (iterations)
- make a delay after each function execution for previously predefined number of seconds
One big request is that solution must be Ajax compatibile.
Say:
<script>
functon my_function(numberoftimes, secondsdelay){
//do ajax requests for numberoftimes, separeted by secondsdelay
$.ajax(
{
type: "GET/POST",
url: "exampleurl",
data: "key=value",
}
)
}
<script>
<button onclick="my_function(3,1)">Do it</button>
how?
Thanks.