Skip to content

Instantly share code, notes, and snippets.

@rfischer20
Created May 8, 2012 21:49
Show Gist options
  • Save rfischer20/2639659 to your computer and use it in GitHub Desktop.
Save rfischer20/2639659 to your computer and use it in GitHub Desktop.
String heredocs for inserting node content
add_comment = (data) ->
if data.state == "success"
html = """
<tr>
<td class='avatar'>
<img src='#{data.comment.avatar_url}'/>
</td>
<td>
<h4>#{data.comment.name}<h4>
<h5>#{data.comment.date}</h5>
<p>#{data.comment.message}</p>
</td>
</tr>
"""
$("#add_comment_row").before(html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment