Message from JavaScript discussions
November 2017
— You can set a namespaceURI
though and query it
But the 2 main uses are either pulling templates from script
or template
tags, or getting the tagString via XHR
— I should probably add a method that accepts a tagString directly too, but that breaks my personal rules
— IMO having html anywhere in a js document is a big no no, it's an old principle called Unobtrusive JS
— I tend to lean towards the old ways like that because they are not convoluted like today's standards and frameworks
— Yes, that's the core principle behind it
— So the template engine works as quickly as possible to convert a tagString to real nodes, then works on those
— I think it does some of what you want... with a custom injector
— This one doesn't bind, it's one-way
— Heres an injector that comes with it, you can add custom ones
—
// Wraps the entire element in an `<a>` tag and sets it's `href` attribute.
"data-link-wrap": function (input, target) {
var a = document.createElement("a");
a.setAttribute("href", input);
a.insertAdjacentElement("afterbegin", target.cloneNode(true));
target.parentNode.replaceChild(a, target);
— That definitely looks like it does some structure related things like you said