Skip to content

Instantly share code, notes, and snippets.

@jdlich
Created August 3, 2011 00:12
Show Gist options
  • Save jdlich/1121583 to your computer and use it in GitHub Desktop.
Save jdlich/1121583 to your computer and use it in GitHub Desktop.
function buildNotifications(data) {
var html = ' \
{% _.each(categories, function(category) { %} \
<div class="notification-trigger"> \
<h3>{{ category.name }}</h3> \
</div> \
\
<div class="notification-content"> \
{% _.each(category.notifications, function(notification) { %} \
<ul class="notifications"> \
<li><a href="#">{{ notification.title }}</a></li> \
</ul> \
{% }); %} \
</div> \
{% }); %} \
';
var template = _.template(html, data);
$(".notification-container").append(template);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment