Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer.

You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer.

Scheduled Pinned Locked Moved Uncategorized
9 Posts 6 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • firefoxwebdevs@mastodon.socialF This user is from outside of this forum
    firefoxwebdevs@mastodon.socialF This user is from outside of this forum
    firefoxwebdevs@mastodon.social
    wrote last edited by
    #1

    You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:

    firefoxwebdevs@mastodon.socialF nerdnz@cloudisland.nzN jonkoops@mastodon.socialJ ryanphjohnson@mastodon.socialR leonardodiottio@mastodon.socialL 5 Replies Last reply
    0
    • firefoxwebdevs@mastodon.socialF firefoxwebdevs@mastodon.social

      You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:

      firefoxwebdevs@mastodon.socialF This user is from outside of this forum
      firefoxwebdevs@mastodon.socialF This user is from outside of this forum
      firefoxwebdevs@mastodon.social
      wrote last edited by
      #2

      Here are the full docs https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API

      xela@troet.cafeX 1 Reply Last reply
      0
      • firefoxwebdevs@mastodon.socialF firefoxwebdevs@mastodon.social

        Here are the full docs https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API

        xela@troet.cafeX This user is from outside of this forum
        xela@troet.cafeX This user is from outside of this forum
        xela@troet.cafe
        wrote last edited by
        #3

        @firefoxwebdevs awesome! Now we only have to wait for "baseline" ๐Ÿ˜‰

        firefoxwebdevs@mastodon.socialF 1 Reply Last reply
        0
        • xela@troet.cafeX xela@troet.cafe

          @firefoxwebdevs awesome! Now we only have to wait for "baseline" ๐Ÿ˜‰

          firefoxwebdevs@mastodon.socialF This user is from outside of this forum
          firefoxwebdevs@mastodon.socialF This user is from outside of this forum
          firefoxwebdevs@mastodon.social
          wrote last edited by
          #4

          @xela hopefully it won't be too long! Just Safari to go

          1 Reply Last reply
          0
          • firefoxwebdevs@mastodon.socialF firefoxwebdevs@mastodon.social

            You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:

            nerdnz@cloudisland.nzN This user is from outside of this forum
            nerdnz@cloudisland.nzN This user is from outside of this forum
            nerdnz@cloudisland.nz
            wrote last edited by
            #5

            @firefoxwebdevs It's back! ๐ŸŽ‰

            1 Reply Last reply
            0
            • firefoxwebdevs@mastodon.socialF firefoxwebdevs@mastodon.social

              You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:

              jonkoops@mastodon.socialJ This user is from outside of this forum
              jonkoops@mastodon.socialJ This user is from outside of this forum
              jonkoops@mastodon.social
              wrote last edited by
              #6

              @firefoxwebdevs Fantastic! Canโ€™t wait for this to be in baseline!

              1 Reply Last reply
              0
              • firefoxwebdevs@mastodon.socialF firefoxwebdevs@mastodon.social

                You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:

                ryanphjohnson@mastodon.socialR This user is from outside of this forum
                ryanphjohnson@mastodon.socialR This user is from outside of this forum
                ryanphjohnson@mastodon.social
                wrote last edited by
                #7

                @firefoxwebdevs this is fantastic! This has bitten me in the past, and I'm excited to be able to use this soon!

                1 Reply Last reply
                0
                • firefoxwebdevs@mastodon.socialF firefoxwebdevs@mastodon.social

                  You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:

                  leonardodiottio@mastodon.socialL This user is from outside of this forum
                  leonardodiottio@mastodon.socialL This user is from outside of this forum
                  leonardodiottio@mastodon.social
                  wrote last edited by
                  #8

                  @firefoxwebdevs Looks great but why is it called setHTML? What is the โ€˜setโ€™ supposed to mean?

                  #WebDev #HTML

                  firefoxwebdevs@mastodon.socialF 1 Reply Last reply
                  0
                  • leonardodiottio@mastodon.socialL leonardodiottio@mastodon.social

                    @firefoxwebdevs Looks great but why is it called setHTML? What is the โ€˜setโ€™ supposed to mean?

                    #WebDev #HTML

                    firefoxwebdevs@mastodon.socialF This user is from outside of this forum
                    firefoxwebdevs@mastodon.socialF This user is from outside of this forum
                    firefoxwebdevs@mastodon.social
                    wrote last edited by
                    #9

                    @LeonardoDiOttio I see what you're getting at, but replaceChildrenWithParsedHTML is a bit long.

                    Fwiw when you set innerHTML you're not really setting the HTML either.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups