jQuery.doTemplate

doTemplate is a jQuery template plugin build around the high performance doT template engine, which is where the name come from and, well, it clearly state what it does do too :)

Compilation time is where doTemplate is excel, thanks to doT, the compilation results are stored as strings until they are requested to be converted to DOM (using toDOM() method or inserted into the dom (using the rendering methods). This allows for better compilation time and more flexibility as you can access the compiled items through the template items property, convert it into a jQuery object and access it or simply use on of the rendering methods to rendering to the document.

The template function is automatically cached and when items are converted to jQuery a data object is attached containing the source, data, compiler function and compiled string for the item being converted, this allow for creation of template based on existing data accessible in the DOM as well as based on an existing doTemplate instance.

Best thing is to try it and make your own mind, hopefully there is enough at github to help you get started :)

Posted in Plugins & engines | Leave a comment