$.ajax({
url: '/api/1.0/tweets.php?username=' + username
}).done(function (data) {
//For loop here to do something multiple times
)};
I have this piece of code. I'm trying to get something on my web page to display one at a time, but I believe the problem with my code is that done()
is causing nothing to return until the entire for loop is finished.
- I want to just do the ajax call to the url once.
- I want to execute the for loop, but after each iteration, I want to return something (the ajax? I'm not sure what it's called, I'm still new to this Javascript stuff).
Maybe there's another function other than done()
?