Created
May 14, 2016 20:43
-
-
Save wildeyes/9711c53bf0869e781477e8a81c8b286b to your computer and use it in GitHub Desktop.
Async Script Loading in Browser Javascript Snippet
This file contains 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(url) { | |
var scriptTag = document.createElement('script'); | |
scriptTag.type = 'text/javascript'; | |
scriptTag.async = true; | |
scriptTag.src = url; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(scriptTag, s); | |
})(URL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment