HTML Template Tag - HTML5 & JavaScript - Part 8

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

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

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

    You are very good! the way you explained this topic is much, much better than anyone else on the internet! Thank you very much

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

    best information

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

    Very well explained, tyvm

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

    Man, this is a really good concept!! Of course template is not new. But the way that you made, was nice. To make even better, we can create a function and using something like something(“class-name”, “content”) or even passing an away. Anyway, good insights from this video. Thanks!!

  • @otom8872
    @otom8872 3 года назад +2

    So helpful, thanks man!

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

    Thanks dude, it really help me to understand :D

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

    A very clear explanation - thank you

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

    great job

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

    We can also use template strings in js to make that template code. It's just like writing the html code as a js string and changing the INNERHTML of any element to that string. I think it's more dynamic, as you can set ids dynamically and all at one place. ( template strings are strings written between back ticks ``)

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

      You could, but it's not the same. And it's questionable if it's more dynamic or not.

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

      @@ExcelGoogleSheets Yeah I was just telling you my way of doing the same. 😁✌

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

    great tutorial!

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

    much needed

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

    This is very interesting. I'm trying to figure out how to use this for dynamic content.
    For instance, say I have a table with 5 headers. The content of each row is dynamic and does not exist until an action from the user is performed (a button click or something that initiates some JS that parses data from an external source (another website or something) and places its findings in an array of strings). That array is then used to create the contents of the table data (embedded in a element). Would using the element apply to this type of scenario?

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

    thank u for all GOD bless u

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

    cool video, how do u use regex to replace IDs in many parts of the html template like cartitemID with cartitem2 for example. this has been a unclear mess getting it as a string to run regexs n back to a element node i can then add to doc

  • @B유
    @B유 5 лет назад

    so good

  • @matusalemdamarin4060
    @matusalemdamarin4060 6 месяцев назад

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

    Hi, is it possible to update the contents inside the template tag dynamically?

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

      It depends on your definition of "update". It returns a document fragment object developer.mozilla.org/en-US/docs/Web/API/DocumentFragment , which lives in memory and it can be inserted to the DOM. Once inserted the fragment will disappear.

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

    can i use a template inside a template?

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

    But who wants to repeat same content on one same page? I expected something like a navigation bar with a log which can be replicated all 150 pages and if i want to change something in the nav bar I just change one file or one line of code.

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

      You're confusing front-end web development with back-end (server-side) web development.
      What you want is performed on server-side.

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

      @@ExcelGoogleSheets Is there a way to perform what I want on the client side, with javascript? It must be... I guess...

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

    🙏🏻