Skip to content

Instantly share code, notes, and snippets.

@tathamoddie
Created July 28, 2010 06:51
Show Gist options
  • Save tathamoddie/493617 to your computer and use it in GitHub Desktop.
Save tathamoddie/493617 to your computer and use it in GitHub Desktop.
$(function() {
var tagIndex = 0;
$('span[tag]')
.each(function() {
var target = $(this);
var tag = target.attr('tag');
target.data(
'template',
$.templates('tag' + tagIndex, '${' + tag + '}'));
tagIndex++;
});
});
function update(data) {
$('span[tag]')
.each(function() {
var target = $(this);
var template = target.data('template');
target.html($.tmpl(template, data));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment