Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

HTML and Css

cocotiwak 120

@cocotiwak

Desktop design screenshot for the Results summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Still dont know how to write JS script for update HTML with JSON file. Any clue Friends ?

Community feedback

P
Dean 480

@Deanogit

Posted

Hello Friend,

There are a few different ways of getting the data from the JSON file.

For this challenge I used the fetch() method.

⁄⁄ Fetch a JSON file

fetch('./data.json')

⁄⁄ Next we need to use the .then() method and the .json() method to parse the response from the fetch() method

.then((response) => {
return response.json();
})

⁄⁄ Now another .then() method 
.then((data) => {

⁄⁄ We now have the parsed data in a format we can use in JavaScript 
}

Honestly I struggle to explain how this works, so I'm gonna leave this here for now 😵‍💫

0

@jonhenrikaavitsland

Posted

some resources for you :)

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API https://developer.mozilla.org/en-US/docs/Web/API/Response/json

0

cocotiwak 120

@cocotiwak

Posted

@jonhenrikaavitsland thx. Already update the solution with JSON data now.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord