diff --git a/ejs-render-remote.js b/ejs-render-remote.js index 860ad5c..d5efdea 100644 --- a/ejs-render-remote.js +++ b/ejs-render-remote.js @@ -40,11 +40,15 @@ getTemplateFn.then(function(template) { var templateOptions = overwriteWithCacheOptions(options, templateUrl); - $('#' + r).replaceWith(ejs.render( - template, - data, - templateOptions - )); + try { + $('#' + r).replaceWith(ejs.render( + template, + data, + templateOptions + )); + } catch(ex) { + console.error(templateUrl, ex); + } //clean up the getFnFor if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) { diff --git a/examples/templates/hello.ejs b/examples/templates/hello.ejs index eb1fabd..81f8da5 100644 --- a/examples/templates/hello.ejs +++ b/examples/templates/hello.ejs @@ -1 +1 @@ -Hello <%= name%>! +Hello <%= name %>!