1
0
Fork 0
owenryan.us/source/assets/utils.js

9 lines
337 B
JavaScript

// Some useful functions used throughout my code
// Based on this SO answer https://stackoverflow.com/a/35880730/9523246
function lazyLoadCSS(url) {
const css = document.createElement('link');
css.href = url;
css.rel = 'stylesheet';
css.type = 'text/css';
document.getElementsByTagName('head')[0].appendChild(css);
}