Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function loadScript(src, callback) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = src;
if (callback) {
script.onreadystatechange = script.onload = function() {
callback();
};
}
document.body.appendChild(script);
}
// Example Usage
window.onload = function() {
loadScript('http://feather.aviary.com/js/feather.js', function() {alert('loaded');})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.