Skip to content

Instantly share code, notes, and snippets.

@joshghent
Created May 5, 2021 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshghent/f502c3d6d0786de3b8d3834bb7de4787 to your computer and use it in GitHub Desktop.
Save joshghent/f502c3d6d0786de3b8d3834bb7de4787 to your computer and use it in GitHub Desktop.
function loadScript(src, done) {
var js = document.createElement('script');
js.src = src;
js.onload = function() {
done();
};
js.onerror = function() {
done(new Error('Failed to load script ' + src));
};
document.head.appendChild(js);
}
loadScript("./src/polyfill-io.js, () => {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment