Assigning large multi-line HTML/text blocks to variables

  • Thread starter Catherine Lynn Wood
  • Start date
C

Catherine Lynn Wood

I am working on a dynamically built HTML in both ASP and client-side
scripting. A current step I am working on will vary the content of a table
cell based on tab items clicked by the user. I wish to have the cell
content changed from an HTML table (created by the ASP when the page is
served up) or alternately a number of image files.

I am assuming that the innerHTML construct is the best fit to do this but
that will mean that the HTML table will need to ultimately be assignable to
that innerHTML DOM object. So what I need to know is, how to take a chunk
of HTML or text in general that consists of multiple lines and assign it to
a single variable short of wrapping quotations around each line along with
an endless number of concatenation operators.

I know that unix scripting languages like to use a <<EOF type construct to
do this, but I am not aware if there is anything similar in javascript to do
the same thing. If all else fails, I will go back to the individual dom
properties to build my HTML there, but I was curious if there was a way just
to grab a block of text in a javascript variable...

Kathy Lynn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top