Hi Simon,
Before browsers implement & ship <template> the two options you list
above are your basic choices, and each has drawbacks:
-Using <template> with display:none means you have to take care to not
accidentally fetch resources or run script (e.g. <template><img
src="/myImages/{{ replaceMe }}/"></template>), and you won't be able
to use it in certain locations (e.g. <table><template><tr>, or
<select><template><option>
-Using <script type="myTemplate"> means your templates are just text
(not parsed), and you'll need to parse them with innerHTML (and take
care not to create XSS vectors). It also means your template's can't
include a </script> tag.
If you care about security (XSS), I would recommend using an existing
library that's widely deployed and well vetted. Templating is each to
get kind-of working and hard to get all the kinks worked out of.
>
> Thanks
> -Simon
>
>