Skip to content

Instantly share code, notes, and snippets.

@BrunoGiubilei
Created March 31, 2022 14:16
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 BrunoGiubilei/e9ba8a48c4511a7a665c2bd19333ed49 to your computer and use it in GitHub Desktop.
Save BrunoGiubilei/e9ba8a48c4511a7a665c2bd19333ed49 to your computer and use it in GitHub Desktop.
Load external script
function carregaJS(u, c) {
var d = document, t = 'script',
o = d.createElement(t),
s = d.getElementsByTagName(t)[0];
o.src = u;
if (c) { o.addEventListener('load', function (e) { c(); }, false)}
s.parentNode.insertBefore(o, s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment