Skip to content

Instantly share code, notes, and snippets.

@xero
Created August 8, 2013 14:03
Show Gist options
  • Save xero/6184844 to your computer and use it in GitHub Desktop.
Save xero/6184844 to your computer and use it in GitHub Desktop.
load a handlebars template via ajax then use it as a backbone view
$.ajax({
url: 'ui/tpl/login.handlebars',
context: this,
cache: true,
success: function(data) {
var tpl = Handlebars.compile(data);
this.$el.html(tpl(this.model.toJSON()));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment