Created
October 2, 2012 07:03
-
-
Save skoon/3816954 to your computer and use it in GitHub Desktop.
TypeScript file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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