Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Handlebars basic function.
function templateLoad(templateName, dataSource, htmlNode, callback) {
var templateFile = 'partials/' + templateName + '.html';
jQuery.get(templateFile, function(template) {
var renderedTemplate = Handlebars.compile(template);
var result = renderedTemplate(dataSource);
if(callback != null) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.