Skip to content

Instantly share code, notes, and snippets.

@ahirschberg
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahirschberg/e0ac529508c6302e5e1b to your computer and use it in GitHub Desktop.
Save ahirschberg/e0ac529508c6302e5e1b to your computer and use it in GitHub Desktop.
// try 2
// indentation looks better, but now the style is inconsistent:
books.forEach(function (book) {
$('<li/>').html( // statement.method(... here
$('<a>') // statement[\n].method(...) here
.attr('href', 'book.html')
.append(
$('<h2/>').text(book.title)
)
).click(function () {
do_something(book);
}).appendTo('#book-list');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment