Every JavaScript Dev Should Know This (Defer Attribute)

preview_player
Показать описание
In today's video we're going to take a look at the 'defer' attribute in HTML and JavaScript. This can be used to increase the quality of code on your website, and resolve some errors 🙂

This can be used to resolve the "cannot read properties of null" JavaScript error.

For your reference, check this out:

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

#dcode #javascript
Рекомендации по теме
Комментарии
Автор

Worth to add: "the defer attribute has no effect on module scripts — they defer by default." (MDN)

michajankowski
Автор

thx for so good solution and not long explanation mate

אופירבינדר
Автор

Thanks for the video. Is defer the same as "DOMContentLoaded"?

yannik
Автор

Thank you for this quick and helpful video.

MahbubTonoy
Автор

Hi! Great video, how do you execute inline js placed on a script tag on the page at the bottom, that need the defer files on the header to be loaded first? how is the order of execution and how to make shure that the defer files are loaded before execution of the bottom scripts on the page? thanks.

Vemovemo
Автор

OMG wow, never understood it till this point. Finally you made it clear

naeem
Автор

You're the best at programming. I like you so much 😎

Guilmon-jv
Автор

Does it make sense to add defer if external script is added in body?

AnandSingh-jogf
Автор

Hey Dom, every time I got stuck something I search on YouTube and most of the you're the first who appears me and then when I click that video I really understand what I'm looking for you're great person, knowledgeable person at least for me, and you're not deserve this count of audience is very very little when it compares you other channels although you're more knowledgeable then them I recommend you to make a 3-8 hour course and then publish a free code camp or traversy media I see a lot of people doing that and there audience increases thanks bro for sharing these valuable content,
From a guy who use you're content almost every day 🙏🏽 ❤

mohsinbashir
Автор

Bro could you make a video about how to create a loading section before the data from an api is rendered and render error when there is a problem with the api using fetch api with async await in react.

enthusiatic_coder
Автор

That one I was facing issues thanks bro.

samarthsingh
Автор

Perfect timing! Just had this issue when making my portfolio

MattRx
Автор

<script defer src="index.js"></script>
Gonna use to forever now

nikhilrauniyar
Автор

Thanks. You're the JavaScript whisper!

gioba