Flooding DOM by using HTML templates

Photo by Irvan Smith on Unsplash

Some time back I’ve discovered and started to use an amazing feature of HTML 5: templates. If you never heard about it – you definitely should visit HTML 5 Rocks website to read about pros and cons of these functionality. But anyway this post is not about feature itself, but about some pitfall, which I’ve faced after some time.

So, let’s imagine, that you are going to write some page with a dynamic content, which will be generated by using some AJAX calls and templates mechanism. For example you are not satisfied with slow data-binding from existing frameworks (all of them are too generic) and you developed your own data-binding with blackjack and… anyway, you have some HTML:

Continue reading “Flooding DOM by using HTML templates”