Introduction to the DOM

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 38

  • @bredmond812
    @bredmond812 5 лет назад +11

    I've been watching a lot of programming tutorials. I heard your voice for 5 seconds, checked what content you have, and subscribed right away. The voice did it.

  • @sumanthprabhu11
    @sumanthprabhu11 3 года назад +1

    You are the Godfather Of Teachers

  • @rotrose7531
    @rotrose7531 4 года назад +2

    Thank you MILLIONS! My GOAL: continue to learn each of your video at least twice and become a js expert in my small circle.

  • @RC_1930
    @RC_1930 5 лет назад +2

    JavaScript was never so relaxing. Great !!!

  • @FckUAll87
    @FckUAll87 6 лет назад +2

    best teacher ever. thank you so much

  • @brucewayne252
    @brucewayne252 Год назад

    I always wanted to make a great youtube channel about javascript concepts. But the job is done thanks to you. Now I will look for other ways to contribute to humanity and just forward people here for Javascript :)

  • @goodpanda4082
    @goodpanda4082 3 года назад

    i was tring to learn js but didn't find anything useful but you are awesome sir hates off to you!
    Thank you!!!

  • @SimPwear84
    @SimPwear84 6 лет назад

    I checked this playlist, listened on how you explain the concepts and immediately subbed! Nice work and thank you Steve

  • @joeyng1282
    @joeyng1282 4 года назад

    Cool! Thanks a lot, dude!

  • @tanercoder1915
    @tanercoder1915 4 года назад

    you are the first person I met who used Brackets in JS course. I find many plugins were updated around you did this course. seems, like Brackets' gave away popularity to other editors like VC Studio and alike.

  • @theetopian6167
    @theetopian6167 4 года назад

    The only person, I can disable my adblocker for.

  • @chiragr1336
    @chiragr1336 4 года назад +1

    @Steve Griffith Thanks for making these videos. Learning is so easy and fun. I request you to please make a video on how the document object is created for the JavaScript code? And what creates it? Thanks!

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад

      The browser automatically creates your DOM from the HTML on the page. This video is part of a whole playlist I have on the DOM.

  • @N3fario
    @N3fario 5 лет назад

    Hey, thanks for the great video. Since async allows the javascript files to be ran without delaying the page load, I was wondering if this could be hazardous because you could set the paragraph textcontent to something before the page has loaded (before that html tag exists). Thanks again!

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  5 лет назад

      A good practice is to always test for current conditions before you do something. If you depend on the html being there then wrap your code in a function to be called after the DOMContentLoaded event.

  • @kenosabi
    @kenosabi 2 года назад

    Algo boost.

  • @CesarJuarezVargas
    @CesarJuarezVargas 7 лет назад

    Is it possible to include loops in order to change (or refresh) methods, thus resulting in different page behaviours each time there is a new visit from the user?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  7 лет назад

      Loops are for repetitive tasks. They can't change your script. Every visit to the page gets a copy of the original JavaScript file from the web server. You can use if statements to change the behaviour based on how the user interacts with a page. You can use random numbers to change behaviour on a page. You can't use JavaScript to change your JavaScript file from the browser.

  • @CesarJuarezVargas
    @CesarJuarezVargas 7 лет назад

    Is there a way to protect elements from being changed or altered through this method? can nodes be secured through passwords, patches, or encryption?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  7 лет назад

      Nope. The HTML in the browser is a copy of the original file from the server. Once it is loaded in the browser everything is fair game. JS can change anything.

  • @Brombrom41
    @Brombrom41 4 года назад

    What is the difference between setting text via textContent and innerHtml ?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад

      TextContent creates a simple text node. Everything passed to that property will be displayed as text.
      innerHTML is a string that will need to be parsed. If there is any HTML elements written in the string it will be converted into the various nodes before being appended to the page

    • @Brombrom41
      @Brombrom41 4 года назад

      @@SteveGriffith-Prof3ssorSt3v3 Thank you. Your answer + this medium.com/better-programming/whats-best-innertext-vs-innerhtml-vs-textcontent-903ebc43a3fc article + self experimenting made it clear. In the process, I discovered TEXT_NODE, COMMENT_NODE, ELEMENT_NODE properties that return 3,8, and 1 respectively.

  • @lur91blaz
    @lur91blaz 6 лет назад

    Steve what is this? Lol, I don't know, this was written alongside the tutorials of cordova that you posted these days.
    This is avoiding that my scripts wont run...it says unexpected token, and a problem with a parser...But this, is what I think the main error which doesnt let the other lines being interpreted well.
    main.html:8 The Content Security Policy 'default-src 'self' data: gap: ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;' was delivered via a element outside the document's , which is disallowed. The policy has been ignored.

    • @lur91blaz
      @lur91blaz 6 лет назад

      Also I did some investigation, it says something about Es-lint, not being able to parse some things, so I downloaded babel-eslint to watch if it worked well and nah xD. Thank you for posting those tutorials.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  6 лет назад +1

      `Unexpected token` usually means something that is mistyped.
      This is JavaScript that I wrote over two years ago. There should be no problems that require Babel or ES Lint. It is very limited, basic scripting. Try to copy and paste the contents of each of the two Javascript files, one at a time, into the Web Dev Console in the browser and see if an error shows up there.

  • @GardenStateDigital
    @GardenStateDigital 7 лет назад

    Why is this important? If I had a long list I would use this instead of writing out in html file itself but, in what other cases would it be helpful?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  7 лет назад +4

      Typically this is used in cases where you or someone else has written the static HTML file and already posted it on the server. A user visits the page and is given a copy of that static HTML.
      Then new content is created for the page - like a new list of movies added to your database OR a user submits a comment about the page OR there is an update to a news story on the page OR the number of upvotes and downvotes on the image changes.
      Now we need to be able to add that new content to the page dynamically. We can't have a person editing the HTML and uploading a new copy to the web server and then email everyone that there is new content. So, with JavaScript, we can dynamically change the contents of the page. We can add things, remove things, or change things.

  • @yarik83men51
    @yarik83men51 5 лет назад

    +++

  • @webstuff56
    @webstuff56 6 лет назад

    Hi Steve: wondering if you'll be doing any basic animation? Wc3 did a great job at NOT! explaining their JS www.w3schools.com/js/tryit.asp?filename=tryjs_dom_animate_3.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  6 лет назад

      I will be doing a lot of videos on HTML and CSS this summer. As part of CSS will be how to animate elements.
      What they are demonstrating on that page is very old code that is not a best practice. In fact, it will give very poor performance. I will be showing how to achieve this sort of effect with CSS.

    • @webstuff56
      @webstuff56 6 лет назад

      That sounds great too Steve, but I was referring to JS

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  6 лет назад

      There might be some. But again, in most circumstances it isn't a best practice. CSS will serve most needs unless you are building a game. Games is not an area that I tend to talk about much.

    • @webstuff56
      @webstuff56 6 лет назад

      Yeah I plan some time to go back and rehash CSS it's been so long, Summer may be good; I want to learn flexbox and grid