I made a function that executes data by requesting data whose id is i.
I want i = 1 -> run() and i = 2 -> run() -> ... i = 10 -> run()
After the first run, the second request and the second run...
However, the result is that ten getJSON requests are executed first .
How do I get the results I want?
Below is the code I wrote.
for(i=0;i<10;i++){
$.getJOSN('a',{id:i},function(data){
collectInfo = JSON.parse(data);
}
run();
}