Skip to content

Instantly share code, notes, and snippets.

@antenando
Forked from AllThingsSmitty/script-loaded.js
Created December 21, 2017 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antenando/e415c9a6ac7aadb3eede12dc7ddee876 to your computer and use it in GitHub Desktop.
Save antenando/e415c9a6ac7aadb3eede12dc7ddee876 to your computer and use it in GitHub Desktop.
Check if any given script has loaded
var myScript = document.createElement('script');
myScript.src = 'http://code.jquery.com/jquery-2.1.4.min.js';
myScript.onload = function() {
console.log('jQuery loaded.');
};
document.body.appendChild(myScript);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment