Skip to content

Instantly share code, notes, and snippets.

@padolsey
Created November 16, 2009 14:11
Show Gist options
  • Save padolsey/236004 to your computer and use it in GitHub Desktop.
Save padolsey/236004 to your computer and use it in GitHub Desktop.
var script = document.createElement('script');
var code = "alert('foo');";
try{
script.appendChild(document.createTextNode(code))
} catch(e) {
// IE
script.text = code;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment