1
0
mirror of https://github.com/S2-/ejs-render-remote synced 2025-08-02 04:30: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();
getTemplateFn.then(function(template) {
document.getElementById(r).outerHTML = ejs.render(
$('#' + r).replaceWith(ejs.render(
template,
data,
{
cache: true,
filename: templateUrl
}
);
));
});
return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>';
@@ -57,10 +57,10 @@
$.get(templateUrl)
.then(function(template) {
var templateFn = ejs.compile(template,
{
cache: true,
filename: templateUrl
});
{
cache: true,
filename: templateUrl
});
ejs.cache.set(templateUrl, templateFn);
@@ -69,5 +69,5 @@
}
return d;
}
};
})(jQuery);