Hi, thanks for your article! I feel like I'm constantly going back and updating old code haha.
Just a thought, I wasn't sure I would always move script tags to end of body, as there are newer 'async' and 'defer' attributes. Would these work well for your revisions? More info here: stackoverflow.com/a/24070373/737393
Full-time web dev; JS lover since 2002; CSS fanatic. #CSSIsAwesome
I try to stay up with new web platform features. Web feature you don't understand? Tell me! I'll write an article!
He/him
It's a very good point, and thanks for that link! The async and defer attributes on <script> tags is one of those lingering things I still haven't played with, but it looks like you're absolutely right, the scripts should be loaded in the <head> with a <script defer ...> so they run after the <canvas> has rendered. I'll add a note to the article, and update my code again!
Comments like yours are my favorite part of dev.to, genuinely constructive criticism 😁
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, thanks for your article! I feel like I'm constantly going back and updating old code haha.
Just a thought, I wasn't sure I would always move script tags to end of body, as there are newer 'async' and 'defer' attributes. Would these work well for your revisions? More info here: stackoverflow.com/a/24070373/737393
It's a very good point, and thanks for that link! The
async
anddefer
attributes on<script>
tags is one of those lingering things I still haven't played with, but it looks like you're absolutely right, the scripts should be loaded in the<head>
with a<script defer ...>
so they run after the<canvas>
has rendered. I'll add a note to the article, and update my code again!Comments like yours are my favorite part of dev.to, genuinely constructive criticism 😁