Guest User

Untitled

a guest
Dec 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function loadTemplate(path, callback) {
  2. var source, template;
  3.  
  4. $.ajax({
  5. url: path,
  6. success: function (data) {
  7. source = data;
  8. template = Handlebars.compile(source);
  9.  
  10. if (callback && typeof callback === 'function') {
  11. callback(template);
  12. }
  13. }
  14. });
  15. };
  16.  
  17. loadTemplate('script/templateTask.html', function (template) {
  18. $(".one").html(template);
  19. });
Add Comment
Please, Sign In to add comment