Skip to content

Instantly share code, notes, and snippets.

@mbunge
Created July 28, 2013 16:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mbunge/6099242 to your computer and use it in GitHub Desktop.
Load JavaScript asynchrone
var loadJsFile = function (filename) {
var fileref = document.createElement('script')
fileref.setAttribute("type", "text/javascript")
fileref.setAttribute("src", filename)
if (typeof fileref != "undefined") {
document.getElementsByTagName("head")[0].appendChild(fileref)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment