Skip to content

Instantly share code, notes, and snippets.

@skoon
Created October 2, 2012 07:03
Show Gist options
  • Save skoon/3816954 to your computer and use it in GitHub Desktop.
Save skoon/3816954 to your computer and use it in GitHub Desktop.
TypeScript file
module bootstrap {
var itemsLoaded = []; //maintain a list of items we have already loaded to prevent duplicates
class bootstrap {
loaded: bool;
scriptSource: string;
scriptTag: string;
head: any;
scriptId: string;
callback: any;
constructor(scriptSource: string, scriptId ? : string, callback ? : () => void)
{
head = document.head || document.getElementsByTagName("head")[0];
scriptId = scriptId || "script" + Math.floor(Math.random() * 1234);
this.scriptSource = scriptSource;
callback = callback || null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment