I've been making a lot of YouTube videos about Web Components lately. I generally like to do my instantiations in the
One of the more common issues I hear from folks, though, is…
To which I say… don't load your JavaScript in the header! Or if you do, add the This is true for any DOM manipulation script, by the way. The Web Component example above will error when loaded in the header because when it runs, the elements inside the custom element might not be loaded into the DOM yet. Loading in the footer, or waiting until the DOM is ready, gets around that. Cheers, Want to share this with others or read it later? View it in a browser. |
Beranda » Tanpa Label » [Go Make Things] My Web Component doesn't load when my JavaScript is in the header
0 Komentar untuk "[Go Make Things] My Web Component doesn't load when my JavaScript is in the header"