Skip to content

Instantly share code, notes, and snippets.

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() {
// Example Usage
window.onload = function() {
loadScript('', 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.