code: function template(str, params){
    return str.replace(/%(\w*)%/g, function(m, key){
      return params[key];
    });
  }
docs: Simple templating from http://stackoverflow.com/questions/377961/efficient-javascript-string-replacement