How to insert html code using javascript?

  • Thread starter Thread starter fl4v
  • Start date Start date
F

fl4v

Guest
Now I know this may sound a little silly but I really can't figure it out.

I have an html tabel where one row changes according to a java script. I usually introduce the new script for the row like this:

var newtext = '<b>My new html inner code! (which is sometimes way longer)</b>';

// caID is the id of the row in the table.
var changeAreaID = document.getElementById('caID');
changeAreaID .innerHTML = newtext;

What I want to know is how to I get the new html code I need from a different file, import it or something, without having to write the html code in the javascript code as strings.

I'm only a beginner at html.
 
read ur infile line by line, using buffer readers etc. to get the html code.
and output it in a system.out.println() or whtever the equvilent is in javascript.
 
Back
Top