why don't you use this instead:$("#test").html("<p>Hi there
"+username+".</p>");

On Mon, Oct 19, 2009 at 10:06 PM, Ron <ronmichael.zettlemo...@gmail.com>wrote:

>
> 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("<p>Hi there <script type='text/
> javascript'>document.write(username);</script>.</p>");
>
> All the script is just stripped out, in both IE and Firefox.
>
> Any ideas what is going on?
>

Reply via email to