The Best Way to Include JavaScript Files in Your HTML - Modules & Defer Tutorial

  Рет қаралды 4,930

dcode

dcode

Күн бұрын

Пікірлер: 16
@fuadcs22
@fuadcs22 11 ай бұрын
You can use alt+up/down arrow to move current line up or down instead of copy paste.
@licokr
@licokr 11 ай бұрын
Clean, fast and slim, only necesssary information.👍👍👍 Thank you!
@dcode-software
@dcode-software 11 ай бұрын
You're welcome!
@dev_ression
@dev_ression 11 ай бұрын
Learning something new every day, thank you bro
@dcode-software
@dcode-software 11 ай бұрын
Glad to hear it 😎
@TomasMisura
@TomasMisura 11 ай бұрын
I have been using the "defer" method for a while. The use of the "module" method is acceptable, but it is more beneficial for developers who have experience with frameworks of any kind and will not be confusing for them. On the other hand, using the "import" method might be useful for learning JSX syntax and preparing ourselves for frameworks.
@dcode-software
@dcode-software 11 ай бұрын
Absolutely! I haven't seen you comment in a while Tomas - hope you're well!
@TomasMisura
@TomasMisura 11 ай бұрын
Hi@@dcode-software , I haven't been watching or commenting on videos related to front-end development, including yours, for a while. I took a break from programming, this is why. Recently, I've decided to return to my long-term project, and I'll be looking to refresh my knowledge from videos like yours
@mohammadabbas1623
@mohammadabbas1623 11 ай бұрын
Helpful
@kerrykreiter445
@kerrykreiter445 11 ай бұрын
Thanks Dom! Great content and very helpful!! I am currently working on a project that uses modules and it is very difficult for me to debug issues for exactly the reason you pointed out. Is there a workaround for accessing variables in my main.js module? I have a bunch of other js files that main.js is importing and really need to keep it as a module. Thank you for all your in-depth and super informative videos!!
@dcode-software
@dcode-software 11 ай бұрын
Hey, I'm glad you found it helpful. If you really need to see the variables in a module, you can assign the variable to the window object.
@tamas-pamas
@tamas-pamas 11 ай бұрын
what was the disadvantage to wrap everything into the domContentLoaded listener?
@dcode-software
@dcode-software 11 ай бұрын
I guess a disadvantage may be that you need to remember to put all your code inside of their (or at least, a "main" function). Whereas if you just use the "defer" attribute then you can avoid doing that completely.
@bmehder
@bmehder 11 ай бұрын
Man's been on a role lately, innit.
@dcode-software
@dcode-software 11 ай бұрын
👀 thanks for being subscribed for so long to notice the change in my uploading schedule
There's Way More to JSON.Stringify Than You Think
9:26
dcode
Рет қаралды 2,7 М.
5 JavaScript Console Methods Every Developer Should Know
8:23
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 2 МЛН
7 Powerful JavaScript Methods You NEED To Know
12:15
dcode
Рет қаралды 5 М.
These CSS best practices might be holding you back
23:28
Kevin Powell
Рет қаралды 30 М.
The New dialog HTML Element Changes Modals Forever
12:09
Web Dev Simplified
Рет қаралды 591 М.
Please stop using px for font-size.
15:18
Coder Coder
Рет қаралды 233 М.
Maps vs. Objects in JavaScript - What's the Difference?
11:48
Code faster with these VS Code shortcuts
8:44
Coder Coder
Рет қаралды 381 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 269 М.