Question
How do I set up a functional example of these airplanes?
Background
I seem to have the initial part working, indicating that my loop may be causing issues. While I can extract the number of planes, I'm facing difficulties displaying all the planes.
You can find my Demo on CodePen here
I've been referring to the documentation available at this link but it lacks a complete functional example. My goal is to showcase the plane name, country, and display a large image. The styling can come later, but right now, I require a functioning example to kickstart my understanding and progress.
Code
API
I am retrieving data from this API endpoint
JSON output
https://i.sstatic.net/pwcUM.png
HTML
<p>There are a total of <span id="planeQuantity"></span> planes in the database.</p> <ul id="planes"></ul>
jQuery from
Javascript
var queryURL = "https://api.worldofwarplanes.eu/wowp/encyclopedia/planes/?application_id=demo"; $.getJSON(queryURL, function (data) { var quantity = data.meta.count; $('#planeQuantity').append( quantity ); var name = data.id.name_i8n; var nation = data.id.nation; var lrgImg = data.id.images.large; $(data).each(function(){ console.log($(this).id); $('#planes').append('<li>' + name + 'is from ' + nation + '<img src="' + lrgImg + '">' + '</li>'); }); })