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

10 lines
337 B
JavaScript
Raw Normal View History

2023-05-16 03:59:18 +00:00
// 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);
}