HTML, CSS, and JS Implementation of a Results Summary Component
Design comparison
Solution retrospective
Throughout this project, I had the chance to acquire several important skills. I learned the following:
- how to center all the content of the `` on the screen using Flexbox;
- how to center text horizontally within a block-level element;
- how to vertically align elements inside a container;
- how to use Flexbox to evenly distribute space between two elements within a container;
- how to use JSON to dynamically update the content on the page.
- It turned out that I couldn't fetch data directly from the local .json file and view it in my browser due to the CORS policy (which wasn't obvious to me 😅). To resolve this issue, I installed the Live Server extension on my local PC and used it.
- This was my first experience working with JSON and using JavaScript to dynamically update content, so I’m not entirely satisfied with the results. It seems there should be a simpler approach available. Besides, it takes a second to load even this small data.json file provided in the challenge, allowing users to see the raw section before the full content is loaded. I can only imagine the delay if there were more data.
- Any tips on improving the HTML, CSS, or JavaScript code would be welcome, especially regarding more efficient ways to use local JSON data for dynamically populating content. I would also appreciate it if you could provide any reliable, modern resources to help me learn more about this.
- Additionally, while developing, I found myself concerned about the security of the code. It seems that malware could potentially be injected through this line in my code:
newIcon.setAttribute("src", `${block.icon}`);
Could anyone here provide advice on how to eliminate the vulnerabilities associated with this?
Community feedback
- @asimsaeed353Posted about 1 month ago
Very Impressive code. I faced difficulty in populating the content dynamically from data.json. Thanks for sharing the resources. I'll appreciate if you take a look at my code for the same challenge and highlight the areas where i can make improvements.
1@Outstandinggirl13Posted about 1 month ago@asimsaeed353 Thanks for the feedback! I'm glad you liked my solution. It seems like this is a common issue for beginners, but fortunately, it’s pretty easy to fix. I’ll take a look at your code, but you should know I’m not a professional, so don’t rely too much on my advice :) I’m still learning what works best and what doesn’t.
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