Error when loading jsrender templates through AJAX
I am trying to write a function to load templates in external files and use them with jsrender . However, I am getting this error: TypeError: elem.getAttribute is not a function [Break On This Error] value = $templates[elem.getAttribute(tmplAttr)]; I have some console.logs showing that the template was retrieved with ajax. The basic code that causes the error is as follows: var path = 'templates/myTemplate.tmpl.html'; var data = searchResultTeasers; var target = $('#results'); $.ajax({ url : path, aysnc : false, success : function(template) { console.log("Path", path); console.log("Template",