Created
September 1, 2014 03:02
-
-
Save jimmylatreille/04f5f6f529b7f2a1d1a8 to your computer and use it in GitHub Desktop.
asynchronously javascript script
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
//asynchronously javascript script function | |
function getScript(url){ | |
var elem = document.createElement('script'), | |
script = document.getElementsByTagName('script')[0]; | |
elem.src = url; | |
elem.type = 'text/javascript'; | |
elem.async = true; | |
script.parentNode.insertBefore(elem, script); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment