Javascript templating with data binding

I played with several js templates. All of them seem to offer fairly standard features and make html generation with JS much easier.

I have yet to find a engine that offers data bindings to elements. I would like to be able to do something like:

  • display a template with data in a separate div
  • update all attributes from this template with new data (not by overwriting all html)

I would like this mostly, so I don't need to add events, etc. into the generated html. I have an application that requests new data every 2 seconds, and updating the innerHTML style will make it very annoying since I have to re-update the dom events associated with this html.

Has anyone seen this type of js template engine?

+5
source share
1 answer

The question was previously asked. What good template language is supported in Javascript? "in which @balupton mentions Implementing Smarty in JavaScript , which apparently can do it.

+1
source

All Articles