Skip to content

Commit 6c77b37

Browse files
committed
Unknown
1 parent 4f29a07 commit 6c77b37

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.

spacetourismwebsite/starter-code/assets/js/destination.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ const tabs = document.querySelectorAll('.tab'),
44
desPara = document.querySelector('.des-para'),
55
desDis = document.querySelector('.des-dis'),
66
desTime = document.querySelector('.des-time')
7-
87
// Fetch data from JSON
9-
url = "/starter-code/data.json"
8+
url = "../data.json"
109
fetch(url)
1110
.then(res => res.json())
1211
.then(
1312
data => {
1413
tabs.forEach(el => {
1514
el.addEventListener('click', () => {
1615
const tabVal = el.value
16+
console.log(tabVal)
1717
tabImg.src = `${data.destinations[tabVal].images.png}`;
1818
desHeader.innerText = data.destinations[tabVal].name
1919
desPara.innerText = data.destinations[tabVal].description
@@ -24,7 +24,6 @@ fetch(url)
2424
}
2525
)
2626
.catch(function (err) {
27-
// some error here
2827
console.log(err);
2928
});
3029
// Get all tab acccess

0 commit comments

Comments
 (0)