INNER CODE UNIT · JavaScript
includeHtmls
ensisoft/detonator · docu/OpenGL Camera_files/songho.js:170
function includeHtmls()
{
let tags = document.getElementsByClassName("include-html");
for(let tag of tags)
{
let js = tag.dataset.js || "";
fetch(tag.dataset.html).then(resp => resp.text()).then(text =>
{
tag.innerHTML = text;
loadJavaScript(tag.dataset.js); // load js if exists
tag.removeAttribute("data-html"); // hide src names
tag.removeAttribute("data-js");
});
}
}