Skip to content

Instantly share code, notes, and snippets.

@vvikramjhu
Created December 14, 2015 03:41
Show Gist options
  • Save vvikramjhu/214e7a95442214559566 to your computer and use it in GitHub Desktop.
Save vvikramjhu/214e7a95442214559566 to your computer and use it in GitHub Desktop.
function loadScript(a, b) {
if (jsArray[a])b && (debugState && root.root.console.log("This script was already loaded %c: " + a, debugStyle_warning), b()); else {
jsArray[a] = !0;
var c = document.getElementsByTagName("body")[0], d = document.createElement("script");
d.type = "text/javascript", d.src = a, d.onload = b, c.appendChild(d)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment