I am trying to use Promises but I don’t know if in this case, are useful.
$.getJSON("url", "data", function(json) {
json.forEach(function(item) {
//do something
$.get("url", "data", function(response) {
//MAKE SURE THIS BODY IS SOLVED BEFORE RELOOP???
});
})
})
The only way I found is to use ajax with async
as false
.
Is there a way to solve this?
Maybe using Promises for example? I tried to think a way to use Promises in a foreach
loop but didn’t find any solution.
I tried this one:
$.getJSON("url", "data", function(json) {
json.forEach(function(item) {
//do something
when($.get("url", "data") {
//do something
})).done(function(response){
//do something
});
})
})
But it doesn’t work. foreach
always relooped.
Thankfulness to my father who stated to me regarding this web site,
this website is really remarkable.
Every weekend i used to pay a visit this site, for the reason that i wish for enjoyment, since this this web page
conations truly good funny stuff too.
Hello, yes this article is truly fastidious and I have learned lot of things from it on the topic of blogging.
thanks.
Wow, amazing blog layout! How long have you been blogging for?
you make running a blog glance easy. The overall look of your site is
magnificent, let alone the content!
whoah this blog is magnificent i like reading your posts.
Keep up the great work! You realize, lots of persons are searching around for this information, you can aid them greatly.
This article is actually a good one it helps new web
users, who are wishing in favor of blogging.
At this moment I am going to do my breakfast, when having my breakfast coming yet again to read
more news.
You’re so cool! I don’t think I have read through a single thing like this before.
So great to discover someone with a few genuine thoughts on this subject.
Really.. thanks for starting this up. This site is one
thing that’s needed on the web, someone with a bit of originality!