Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

We should not foster and propagate wrong concepts to programmers #16

Merged
merged 1 commit into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions fetch-json/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ <h1>Fetch json example</h1>
}
return response.json();
})
.then(function(json) {
for(var i = 0; i < json.products.length; i++) {
.then(function(data) {
for(var i = 0; i < data.products.length; i++) {
var listItem = document.createElement('li');
listItem.innerHTML = '<strong>' + json.products[i].Name + '</strong>';
listItem.innerHTML +=' can be found in ' + json.products[i].Location + '.';
listItem.innerHTML +=' Cost: <strong>£' + json.products[i].Price + '</strong>';
listItem.innerHTML = '<strong>' + data.products[i].Name + '</strong>';
listItem.innerHTML +=' can be found in ' + data.products[i].Location + '.';
listItem.innerHTML +=' Cost: <strong>£' + data.products[i].Price + '</strong>';
myList.appendChild(listItem);
}
})
Expand Down