Created
December 25, 2019 00:03
-
-
Save luislobo14rap/1e9355c3284529b0fedb342a864746c0 to your computer and use it in GitHub Desktop.
require-script.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require-script.js v1 | |
function requireScript(url, scope = document.querySelector('head')) { | |
let script = document.createElement('script'); | |
get(url, function(xhr, data) { | |
script.innerHTML = data; | |
scope.appendChild(script); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require-script.min.js v1 | |
function requireScript(a,b=document.querySelector("head")){let c=document.createElement("script");get(a,function(a,d){c.innerHTML=d,b.appendChild(c)})} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment