Quantcast
Channel: Iterate thru json fetch
Viewing all articles
Browse latest Browse all 21

Iterate thru json fetch

$
0
0

But I thought the data was the variable output of the json resp the line above that.

Is there a link to description about this? I’ve tried fetch from api to div etc…
And also numerous stackoverflow pages. But they are different (in my eyes ofcourse ):smile: from what I have or want to achieve.

I’m pretty sure this example says it but I can’t muster the same result.

fetch('products.json').then(function(response) {
  return response.json();
}).then(function(json) {
  products = json;
  initialize();
}).catch(function(err) {
  console.log('Fetch problem: ' + err.message);
});

Read full topic


Viewing all articles
Browse latest Browse all 21

Trending Articles