Skip to content

Instantly share code, notes, and snippets.

@videlais
Created January 19, 2014 00:12
Show Gist options
  • Save videlais/8498686 to your computer and use it in GitHub Desktop.
Save videlais/8498686 to your computer and use it in GitHub Desktop.
LoadJS Twine Macro
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