Created
July 10, 2017 20:00
-
-
Save jrobinsonc/345d0ea40816e5723dabb8e0888a1c19 to your computer and use it in GitHub Desktop.
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
function addJS(id, url) { | |
if (document.getElementById(id)) { | |
return; | |
} | |
const fjs = document.getElementsByTagName('script')[0]; | |
const js = document.createElement('script'); | |
js.id = id; | |
js.src = url; | |
fjs.parentNode.insertBefore(js, fjs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment