Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Handlebars.getTemplate = function(name) {
- if (Handlebars.templates === undefined || Handlebars.templates[name] === undefined) {
- $.ajax({
- url : 'templatesfolder/' + name + '.handlebars',
- success : function(data) {
- if (Handlebars.templates === undefined) {
- Handlebars.templates = {};
- }
- Handlebars.templates[name] = Handlebars.compile(data);
- },
- async : false
- });
- }
- return Handlebars.templates[name];
- };
Add Comment
Please, Sign In to add comment