Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mythz
Created October 17, 2011 05:44
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 mythz/1292009 to your computer and use it in GitHub Desktop.
Save mythz/1292009 to your computer and use it in GitHub Desktop.
Using CoffeeScript instead of JS Templates
# Who needs js Templates w/ access to CoffeeScript's string interpolation
# It's not only fast (since CS statically compiles to native JS) but you have the full flexibility of JS
$.getJSON "/grids", null, (e) ->
sb = "<dl>"
sb += "<dd>#{grid.Name}</dd>" for grid in e.Results
sb += "</dl>"
$("#grids .results").html sb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment