Iterate thru json fetch
@quintendewilde wrote: Hi I’m learning javascript. And I’m trying to iterate thru a json file with js fetch. I am first retrieving the whole file which I would then use to go through the list and get...
View ArticleIterate thru json fetch
@skaparate wrote: Hello! Could You share the code? Read full topic
View ArticleIterate thru json fetch
@partylich wrote: I would suggest reading the docs on the fetch api. Specifically MDN: Fetch MDN: Response MDN: Body.json() It looks like you’ve already got a handle on Promises (hopefully!); with...
View ArticleIterate thru json fetch
@quintendewilde wrote: So I did this: var myfetch = fetch("https://kanjialive-api.p.rapidapi.com/api/public/kanji/all", { "method": "GET", "headers": { "x-rapidapi-host":...
View ArticleIterate thru json fetch
@partylich wrote: quintendewilde: .then((data) => console.log(data[1].kanji.character)) .then((data) => document.getElementById('kanji').innerHTML = kanji.character) The first line in my quote...
View ArticleIterate thru json fetch
@quintendewilde wrote: 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...
View ArticleIterate thru json fetch
@RandellDawson wrote: quintendewilde: console.log(data[1].kanji.character)) When you return the above, the returned value is undefined. That is because console.log statements have undefined as a...
View ArticleIterate thru json fetch
@partylich wrote: quintendewilde: But I thought the data was the variable output of the json resp the line above that. data in your callback functions does contain the return value of the previous...
View ArticleIterate thru json fetch
@quintendewilde wrote: quintendewilde: document.getElementById(‘kanji’).innerHTML = kanji.character) @RandellDawson Thanks I figured it out with you response! @partylich Your code looks much cleaner...
View ArticleIterate thru json fetch
@quintendewilde wrote: I have a new wall I’m against. I thought I got how it worked for running thru an array and giving a random element. But the code gives me an error in console: TypeError: Cannot...
View ArticleIterate thru json fetch
Hi I’m learning javascript. And I’m trying to iterate thru a json file with js fetch. I am first retrieving the whole file which I would then use to go through the list and get randomly every nth...
View ArticleIterate thru json fetch
I would suggest reading the docs on the fetch api. Specifically MDN: Fetch MDN: Response MDN: Body.json() It looks like you’ve already got a handle on Promises (hopefully!); with that and the above...
View ArticleIterate thru json fetch
So I did this: var myfetch = fetch("https://kanjialive-api.p.rapidapi.com/api/public/kanji/all", { "method": "GET", "headers": { "x-rapidapi-host": "kanjialive-api.p.rapidapi.com", "x-rapidapi-key":...
View ArticleIterate thru json fetch
quintendewilde: .then((data) => console.log(data[1].kanji.character)) .then((data) => document.getElementById('kanji').innerHTML = kanji.character) The first line in my quote references the...
View ArticleIterate thru json fetch
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...
View ArticleIterate thru json fetch
quintendewilde: console.log(data[1].kanji.character)) When you return the above, the returned value is undefined. That is because console.log statements have undefined as a return value. In the second...
View ArticleIterate thru json fetch
quintendewilde: But I thought the data was the variable output of the json resp the line above that. data in your callback functions does contain the return value of the previous step in the chain....
View ArticleIterate thru json fetch
quintendewilde: document.getElementById(‘kanji’).innerHTML = kanji.character) @RandellDawson Thanks I figured it out with you response! @partylich Your code looks much cleaner and structured than...
View ArticleIterate thru json fetch
I have a new wall I’m against. I thought I got how it worked for running thru an array and giving a random element. But the code gives me an error in console: TypeError: Cannot read property 'length'...
View Article