Skip to content

Instantly share code, notes, and snippets.

@feross
Created March 6, 2011 09:24
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 feross/857163 to your computer and use it in GitHub Desktop.
Save feross/857163 to your computer and use it in GitHub Desktop.
$.when( $.getJSON('/some/data/'), $.get('template.tpl') ).then(function( data, tmpl ){
$( tmpl ) // create a jQuery object out of the template
.tmpl( data) // compile it
.appendTo( "#target" ); // insert it into the DOM
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment