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.



On Wed, Dec 15, 2010 at 11:16 PM, Dave M G <dave@example.com> wrote:
> So it's as if the concat() function in Javascript is somehow looking at
> the tree of div tags and adding it onto the outermost branch, instead of
> doing what I wanted it to do, which is just treat it like a string and
> append it to the end.

Have you tried inspecting the "output" before assigning it to the
innerHTML property ?

My guess would be that the concat works as you expect but a
transformation occurs when you assign to the innerHTML property.
That transformation is the the parsing of the HTML string into DOM
nodes then back to a HTML string. If there are any unclosed tags or
other problems in the HTML it may not come out the same as it went in.
Try looking for problems in the HTML. For example, I see that you are
using the same id more than once on the div tags which is not strictly
correct.  Nesting problems though, are more likely caused by
unclosed/unbalanced tags.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links