Guest User

Untitled

a guest
Oct 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Handlebars.getTemplate = function(name) {
  2. if (Handlebars.templates === undefined || Handlebars.templates[name] === undefined) {
  3. $.ajax({
  4. url : 'templatesfolder/' + name + '.handlebars',
  5. success : function(data) {
  6. if (Handlebars.templates === undefined) {
  7. Handlebars.templates = {};
  8. }
  9. Handlebars.templates[name] = Handlebars.compile(data);
  10. },
  11. async : false
  12. });
  13. }
  14. return Handlebars.templates[name];
  15. };
Add Comment
Please, Sign In to add comment