Created
January 19, 2014 00:12
-
-
Save videlais/8498686 to your computer and use it in GitHub Desktop.
LoadJS Twine Macro
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
macros['loadJS'] = | |
{ | |
handler: function(place, object, parameters) | |
{ | |
var se = document.createElement("script"); | |
se.type = 'text/javascript'; | |
se.src = parameters[0]; | |
var hT = document.getElementsByTagName("HEAD")[0]; | |
hT.appendChild(se); | |
if(se.innerText) {eval(se.innerText);} | |
else {eval(se.textContent);} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment