Skip to content

Instantly share code, notes, and snippets.

@yuitowest
Created August 22, 2011 05:25
Show Gist options
  • Save yuitowest/1161724 to your computer and use it in GitHub Desktop.
Save yuitowest/1161724 to your computer and use it in GitHub Desktop.
sample
var appendEntry = function(selector, entry) {
if (entry != undefined && entry.yt.length > 0) {
var $dl = $('<dl/>', {class: 'entry'});
$dl.append($('<dt/>', {class: 'title'}))
$dl.children("dt").append($('<a/>', {href: entry.url, text: entry.title}))
$dl.append($('<dd/>'));
$dl.children("dd").append("<ul/>");
for (i in entry.yt) {
var $li = $('<li/>');
$li.append($('<a/>', {href: entry.yt[i], text: entry.yt[i]}));
$dl.children("dd").children("ul").append($li);
}
$dl.appendTo(selector);
}
}
appendEntry('#data', data[i]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment