1
0
mirror of https://github.com/S2-/ejs-render-remote synced 2025-08-02 20:50:04 +02:00

outerHTML vs replaceWith

This commit is contained in:
s2
2019-04-14 21:54:34 +02:00
parent c1f83b7468
commit c4fc133475

View File

@@ -33,14 +33,14 @@
var r = uuidv4(); var r = uuidv4();
getTemplateFn.then(function(template) { getTemplateFn.then(function(template) {
document.getElementById(r).outerHTML = ejs.render( $('#' + r).replaceWith(ejs.render(
template, template,
data, data,
{ {
cache: true, cache: true,
filename: templateUrl filename: templateUrl
} }
); ));
}); });
return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>'; return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>';
@@ -69,5 +69,5 @@
} }
return d; return d;
} };
})(jQuery); })(jQuery);