Skip to content

Instantly share code, notes, and snippets.

@samuel-alves
Forked from AllThingsSmitty/script-loaded.js
Created February 9, 2017 14:10
Show Gist options
  • Save samuel-alves/ea2ec1f0fff87a7c669ecae2254c6a0a to your computer and use it in GitHub Desktop.
Save samuel-alves/ea2ec1f0fff87a7c669ecae2254c6a0a 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