Skip to content

Instantly share code, notes, and snippets.

@jamesmichiemo
Created June 22, 2014 11:51
Show Gist options
  • Select an option

  • Save jamesmichiemo/57fec3bf87c495162d1c to your computer and use it in GitHub Desktop.

Select an option

Save jamesmichiemo/57fec3bf87c495162d1c to your computer and use it in GitHub Desktop.
an example for gathering JSON data for Handlebars templating
source = $("#id_on_handlebars_script_tag").html()
template = Handlebars.compile source
$.getJSON('some route to json markup', (data)->
$("#content_placeholder").html(template data)
).error ->
console.log "error"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment