Created
March 3, 2015 07:30
-
-
Save xincici/cf7aced5d838fd91d708 to your computer and use it in GitHub Desktop.
run script string
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
//运行插入页面的javascript代码 | |
function loadScriptString(s){ | |
var a = document.createElement('script'); | |
a.type = 'text/javascript'; | |
var t = document.createTextNode(s); | |
try{ | |
a.appendChild(t); | |
}catch(e){ | |
a.text = s; | |
} | |
document.getElementsByTagName('head')[0].appendChild(a); | |
} | |
loadScriptString('alert(1)'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment