Every JavaScript Dev Should Know This (Defer Attribute)

Sdílet
Vložit
  • čas přidán 19. 07. 2024
  • 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:
    developer.mozilla.org/en-US/d...
    🏫 My Udemy Courses - www.udemy.com/user/domenic-co...
    🎨 Download my VS Code theme - marketplace.visualstudio.com/...
    💜 Join my Discord Server - / discord
    🐦 Find me on Twitter - / dcodeyt
    💸 Support me on Patreon - / dcode
    📰 Follow me on DEV Community - dev.to/dcodeyt
    📹 Join this channel to get access to perks - / @dcode-software
    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

Komentáře • 37

  • @michajankowski3615
    @michajankowski3615 Před 2 lety +11

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

  • @MahbubTonoy
    @MahbubTonoy Před rokem +1

    Thank you for this quick and helpful video.

  • @amitkumargupta-
    @amitkumargupta- Před rokem

    Congrats for 100k subs, Domenic!

  • @user-hz7uw4mb3n
    @user-hz7uw4mb3n Před 6 měsíci

    thx for so good solution and not long explanation mate

  • @Vemovemo1
    @Vemovemo1 Před rokem +1

    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.

  • @mohsinbashir2902
    @mohsinbashir2902 Před 2 lety +3

    Hey Dom, every time I got stuck something I search on CZcams 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 🙏🏽 ❤

    • @dcode-software
      @dcode-software  Před 2 lety +1

      Mohsin thank you brother! That's some really kind words I appreciate it. I'm happy my videos help you out!!

    • @mohsinbashir2902
      @mohsinbashir2902 Před 2 lety

      You're welcome bro 🙏🏽

    • @Mohamed-bu1yt
      @Mohamed-bu1yt Před 9 měsíci +1

      your somali warya maa fintahay

    • @mohsinbashir2902
      @mohsinbashir2902 Před 8 měsíci

      @@Mohamed-bu1yt
      Haa sxb setahay

  • @user-su3wq4qd4t
    @user-su3wq4qd4t Před 2 lety +1

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

  • @judeleon8485
    @judeleon8485 Před 2 lety

    Thanks a million Dom.

  • @naeem2057
    @naeem2057 Před 2 lety +3

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

  • @rostyslav5334
    @rostyslav5334 Před 2 lety

    Great thanks!

  • @samarthsingh673
    @samarthsingh673 Před 2 lety

    That one I was facing issues thanks bro.

  • @enthusiatic_coder6801
    @enthusiatic_coder6801 Před 2 lety +1

    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.

  • @AnandSingh-jo6gf
    @AnandSingh-jo6gf Před rokem +1

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

  • @MattRx5
    @MattRx5 Před 2 lety +1

    Perfect timing! Just had this issue when making my portfolio

  • @balenmohammed1657
    @balenmohammed1657 Před 2 lety

    Brilliant person

  • @yannik8271
    @yannik8271 Před rokem +2

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

  • @thanveerahmed1963
    @thanveerahmed1963 Před 2 lety +2

    Thank you so much 💓

  • @ravisankar9122
    @ravisankar9122 Před 6 měsíci

    Thank you so much.

  • @maro22saqr90
    @maro22saqr90 Před rokem

    Thanks Man

  • @cassianocominetti7784
    @cassianocominetti7784 Před 5 měsíci

    Great!

  • @ricardofynn
    @ricardofynn Před 2 lety +2

    Thanks!

    • @dcode-software
      @dcode-software  Před 2 lety

      Sorry I missed your Super Thanks! I'm glad I could help you and thank you for your donation 😊

  • @eidenblock
    @eidenblock Před 2 lety

    thanks for u job

  • @arpanacharya6008
    @arpanacharya6008 Před 2 lety +3

    Your name is DOM ?

  • @gioba4912
    @gioba4912 Před 2 lety

    Thanks. You're the JavaScript whisper!

  • @Medo-jr5cu
    @Medo-jr5cu Před 2 lety +1

    Iam egyption and iam big fan

  • @nikhilrauniyar9084
    @nikhilrauniyar9084 Před rokem

    Gonna use to forever now

  • @flailofthelord
    @flailofthelord Před rokem

    3:15 for those who check comments.

  • @mohammadfaizanmateen3636

    Noice