from your example it looks like it is adding it .. as HTML to the page... 
I assume by 'text' you mean escaped... but your example shows it as not
being escaped..

the mystery DIV element is new to me and I'm sure is causing the problem.

My guess is that its a problem with the HTML in your variable... are your
quotes escaped?





ja-6 wrote:
> 
> 
> I'm dynamically inserting html into a page that only contains an
> image. Such as...
> <html>
>  <body>
>    http://my_domain.com/my_image.jpg 
>  </body>
> </html>
> 
> my script has a large amount of html that i want to insert. the html
> is stored in a variable . Such as..
> var my_var = "<div>HI</div>";
> (the actual html is much larger and more complicated than my example)
> 
> I then have..
> $('body').append(my_var);
> 
> which you would think would insert the html into the page. it doesn't,
> instead it just inserts it as text. The source in Firebug is now...
> <html>
>  <body>
>    http://my_domain.com/my_image.jpg 
>   <DIV><div>HI</div>
>  </body>
> </html>
> 
> NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
> that for some reason and I don't know why.
> The page doesn't render the "<div>HI</div>" as html, it displays it as
> plain text.
> If I use the same code on a page that has some more to it, like
> google's homepage, the extra "<DIV>" isn't there and my html gets
> inserted properly (not as text).
> 
> any clues as to why? is this a bug? am I missing some aspect of web
> pages when they are only images?
> Thanks in advanced for your help.
> Josh
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Advanced-Problem---Any-takers--tf4739677s27240.html#a13556844
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to