-
-
Save cdmoyer/236175 to your computer and use it in GitHub Desktop.
Successfully add JS code?
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
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