I am trying to attach a <script>
node with the following code
<html>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$('body').append('<script>alert(\'foo\');</script>');
</script>
</body>
</html>
I expect the code
alert('foo');
to be added an executed, but actually, the following string is added
');
What is happening here?