Jquery-template is a project mainly written in JavaScript, it's free.
A micro-templating plugin for jQuery (adapted from an original work by John Resig)