nlvo / web-app-from-scratch-1920

Marvel based web app with the latest comic release, series and/or events.
1 stars 0 forks source link

rendering your data to html #8

Closed joanpadolina closed 4 years ago

joanpadolina commented 4 years ago

Your html contains sections with classes and this is what you're selecting in javascript to place text from the data. I Like this way of work because you'll see what you expect in the html and final rendering.

The way I'm doing this is by selecting the wrapper which is one thing and in that wrapper I'm creating new elements in javascript with insertAdjacentHTML .

I don't know which method is more usable but maybe you can find your own workflow with this in mind.

Full code can be seen here:

https://github.com/joanpadolina/web-app-from-scratch-1920/blob/499a7ec27230f4c07978fb8bcb2005170d6be87f/src/modules/createelement.js#L6-L19

Good luck, nice code gurl!

joostf commented 4 years ago

Nice feedback @joanpadolina

nlvo commented 4 years ago

Thanks, finally got around it and it makes the code way more readable! At least, that's what I like to believe 😅.