Skip to content

Instantly share code, notes, and snippets.

@ericf
Created June 3, 2011 15:20
Show Gist options
  • Select an option

  • Save ericf/1006509 to your computer and use it in GitHub Desktop.

Select an option

Save ericf/1006509 to your computer and use it in GitHub Desktop.
<script type="text/template" id="template-user">
<div class="user">
<h3>{name}</h3>
<p>{lifeStory}</p>
</div>
</script>
<script>
YUI().use('node', function(Y){
var user = { name: 'Eric', lifeStory: 'codes all day' },
template = Y.one('template-user').getContent();
Y.Node.create(Y.Lang.sub(template, user)).appendTo('body');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment