Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<!--
<script>
alert('aaa');
</script>
-->
<html>
<head>
<title>test</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
var div = document.createElement('div')
div.innerHTML = document.childNodes[0].data;
var script = div.getElementsByTagName('script')[0];
eval(script.innerHTML);
}, false);
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment