I\'m looking for the most standards-compliant / future-proof method for front-end HTML templating.
There exists a relatively new W3C draft specification for HTML Tem
There is a jsfiddle that demonstrates such a polyfill.
This is template content.
It's really great.
This is regular old content.
/* POLYFILL */
(function templatePolyfill(d) {
if('content' in d.createElement('template')) {
return false;
}
var qPlates = d.getElementsByTagName('template'),
plateLen = qPlates.length,
elPlate,
qContent,
contentLen,
docContent;
for(var x=0; x
As for libraries, and I don't know that they support it yet, but try something like Modernizr and Initializr