Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
simple script loader.js
function initSyntaxHighlighting() {
// code
function loadScripts() {
const scripts = [
src: '',
callback: initSyntaxHighlighting
scripts.forEach(function(script) {
const elt = document.createElement('script');
elt.setAttribute('async', '');
elt.setAttribute('defer', '');
elt.setAttribute('src', script.src);
elt.addEventListener('load', script.callback, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.