Skip to content

Instantly share code, notes, and snippets.

@tmpvar
Created February 8, 2011 05:16
Show Gist options
  • Save tmpvar/815907 to your computer and use it in GitHub Desktop.
Save tmpvar/815907 to your computer and use it in GitHub Desktop.
$(".content").weld({
some : "data",
user : "tmpvar"
}, function(el, key, value) {
if (key === "user") {
el.attr(src, '/path/to/' + value);
}
});
$(".content").weld({
some : "data",
user : "tmpvar"
},
{
insert : function(parent, element, cb) {
// append or prepend or etc
if(cb) {
parent.append(cb(element));
}
else {
parent.append(element);
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment