Comment by cousin_it
6 hours ago
When I first learned that XSLT was going away, I got curious how to achieve the same thing in JS (client-side templating that happens during page load, without any "flash of content"). It turns out there's a very nice way to do it, by using inline scripts that append elements next to document.currentScript. Lean Rada wrote about it here: https://leanrada.com/notes/inline-rendering-currentscript/ and I wrote about it as well: https://vladimirslepnev.me/write
That Lean Rada article is really fun!
Instead of:
How about:
Not as pretty, and you'd have to escape all the quotes, but still pretty usable.
That won't work with trusted types enabled.