[jQuery] Can't insert JavaScript using html function

[jQuery] Can't insert JavaScript using html function


Hi all. I stumbled upon something which may be by design in jQuery
for security reasons, it may be the browsers doing it, but... I found
that any JavaScript I try to put into the html of an object is
ignored. For example, say username is a variable that was already
defined with the user's name:
$("#test").html("

Hi there <script type='text/
javascript'>document.write(username);</script>.

");
All the script is just stripped out, in both IE and Firefox.
Any ideas what is going on?