aboutsummaryrefslogtreecommitdiffstats
path: root/assets/js/loads.js
blob: 71e0173295d22b2d0be9a79ba04beecfac0b04e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function load_js(url) {
  let link = document.createElement("link");
  link.rel = "stylesheet";
  link.type = "text/css";
  link.href = url;
  let head = document.getElementsByTagName("head")[0];
  head.appendChild(link);
}

addEventListener("load", function () {
  if (document.querySelector(".highlight .chroma")) {
    load_js("/css/syntax.css");
  }
});