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

Iterate thru json fetch

$
0
0

@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": "kanjialive-api.p.rapidapi.com",
		"x-rapidapi-key": "x"
	}
})

myfetch
.then((res) => res.json())
.then((data) => console.log(data[1].kanji.character))
.then((data) =>  
    document.getElementById('kanji').innerHTML = kanji.character)


.catch(err => {
	console.log(err);
});

And now I see undefined on my html page.
Where do I need to look into to get this pushing of data on to html.

Read full topic


Viewing all articles
Browse latest Browse all 21

Trending Articles