Created
December 5, 2012 03:57
-
-
Save lean8086/4212062 to your computer and use it in GitHub Desktop.
How to self-delete a script
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
// Create the "script" element | |
var script = document.createElement('script'); | |
// Append | |
document.getElementsByTagName('head')[0].appendChild(script); | |
// Delete | |
script.parentNode.removeChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment