Time tracking dashboard made using HTML, CSS, and vanilla JavaScript
Design comparison
Solution retrospective
please is there is any way to prevent JavaScript from moving to next line while sending a fetch request??. Any feedback from the community will be helpful.
Community feedback
- @Cats-n-coffeePosted over 2 years ago
Hi!
First, it's pretty nice! To try answering your question (which I assume refers to the error in the console?), because you are fetching the Json data (which is an asynchronous operation), and using the variable in a synchronous function, your jsonData variable is undefined because the response is not back yet (it will come back after the synchronous code has ran). I would suggest watching a video on this (such as this popular one https://www.youtube.com/watch?v=8aGhZQkoFbQ), or reading the Mdn docs about that (https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous). You could use events such as 'load' or 'DOMContentLoaded' to wrap parts or your code, or make the functions that need the json asynchronous functions as well (that can eventually look messy), and/or reorganize the order of execution.
Your solution isn't fully responsive as you have the desktop breakpoint around 400px, so the boxes are getting off the screen. On desktop, there is a small scroll on the y axis, which you could probably get rid off for better UX.
You could also make the list with daily, weekly, monthly, and actual html unordered list, and list items.
Hope that helps!
0@winninggodspowerPosted over 2 years ago@Cats-n-coffee Thanks. I really appreciate. I'll check the doc and video. And the l will try fixing the responsive issue I'm having. I saw that error but ignored it because the breakpoint in the style.md file said 350px. But I'll see how I can fix it!!. Thanks!!
0@winninggodspowerPosted over 2 years ago@Cats-n-coffee woah!! the video was really good. I thanks a lot
0
Please log in to post a comment
Log in with GitHubJoin 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