Skip to content

Instantly share code, notes, and snippets.

@peaceintheheart
Created July 6, 2020 20:03
Show Gist options
  • Save peaceintheheart/fd3515b4529d4b01403b8ae0bb4636e2 to your computer and use it in GitHub Desktop.
Save peaceintheheart/fd3515b4529d4b01403b8ae0bb4636e2 to your computer and use it in GitHub Desktop.
function renderTheParks(responseJson){
console.log(responseJson)
for (let i = 0; i < responseJson.data.length; i++){
let imageURL = null;
if(responseJson.data[i].images.length > 0){
imageURL = `'${responseJson.data[i].images[0].url}'`;
}
$(".parks").append(
`<div>
[<p>states: '${responseJson.data[i].states}'</p>
<p>image: ${imageURL}</p>
<p>fullName: '${responseJson.data[i].fullName}'</p>
<p>parkCode: '${responseJson.data[i].parkCode}'</p>],
</div>`
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment