@jacksonwhiting
Posted
Nice work on this. I learned quite a bit by looking at your code. I like how you used restructuring to pull out variables from the API data.
How do you like writing HTML in Javascript files using inner.html. Using querySelector and updating textContent on each node is getting old for me. I'm looking at possibly implementing a lightweight templating language while I keep working with vanilla javascript (and no framework) just to make things a bit quicker and easier updating DOM nodes.
Thoguhts?
@beqarion
Posted
@jacksonwhiting
Thanks a lot <3 I'm glad you have taken something valuable from this one.
Targeting nodes separately and updating their content separately - that feels old to me too. But while focusing on vanilla JS, I think this older approach is okay. Maybe its like learning history :))
On this one, I used a little bit different approach. First, I used dummy HTML in the index.html file, styled it, and then cut it and pasted it into the JS code to populate it with data, and pushed it as a whole back into index.html, in the container node.
Actually, I don't like it too much. In small projects, I think it's acceptable. Although Tailwind CSS works fine on strings like that, I don't think it's the future of my coding. I'm going to switch to React, I think. It's somehow similar to my approach here. Templating language? I don't know. I think maybe I could use one if I started to work with Node + Express though."