Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Javascript and I have different ideas about what "concatenate" means.



Marco, David, Ruben,

Thank you for responding.

Just for clarity, the divs all have classes, not IDs, and I removed the
last forward slash at the end of the code that might have been causing
trouble.

So I'm pretty sure I've got the HTML syntax right.

Also, I dumped the content of my output variable to console.log() and it
seems to be formatting correctly, so Marco's suggestion that innerHTML
is doing some kind of validation seems to be right. The content of the
variable is right, but innerHTML is parsing it into crap.

So I've been looking for ways to write the variable into the div, and
everything works in some weird way. I've tried insertBefore (doesn't
seem to like nested divs), writeIn (clobbers the whole page), and
appendChild (don't know what the heck it's doing).

Isn't there some way you can just dynamically write a chunk of prepared
HTML into an existing page? The chunk of HTML I'm writing comes from a
JSON returned from the server, so I want to be able to rewrite the div
contents whenever I get new data.

-- 
Dave M G


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links