I looked at a few of these solutions, and though nice ideas, I highly recommend not to introduce another library/framework unless you really have to.
I ended up using a simple (yet effective) solution, that may fit your needs too:
templates = {
contact_details : function( data ){
return "<p>" +
"Name: " + data.name + "<br>" +
"Phone: " + data.phone + "<br>" +
"email: " + data.email " +
"</p>";
}
and then you simply use (with jQuery) as:
$(this).append( templates.contact_details(p) );
or for adding multiple instances (using jQuery's each):
var output = '';
$.each( persons, function(p){
output+= templates.contact_details(p);
});
you get:
1. Total control of what's happening (no "black box") to debug later.
2. if you have decent IDE - since all templates are under one object you get code completion of your available templates!
quick, and simple.