Permalink
Browse files

[+] Template fetcher function added

  • Loading branch information...
1 parent b2ff6ab commit b2ddda59a0d0d0b443cb21a5679e96e8e613f4df @Andrew8xx8 committed Jul 28, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 blame.js
View
@@ -44,7 +44,13 @@
};
blame.fetchTemplate = function(template, data){
-
+ var result = template;
+
+ for(var i in data) {
+ name = '{' + i + '}';
+ result = result.replace(name, data[i]);
+ }
+ return result;
};
blame.register = function() {

0 comments on commit b2ddda5

Please sign in to comment.