This is what I have tried:
$("#container").replaceWith('<div>Hello</div><script>console.log(a);</script>')
the final result will have no script tag.
for clarity :
replaceWith(content),the content was returned from server ,through ajax.
the javascript has been stripped out,feature or bug?